Skip to content

Commit c4f8bc8

Browse files
committed
Small cleanup
1 parent 8ae11e0 commit c4f8bc8

File tree

2 files changed

+3
-6
lines changed

2 files changed

+3
-6
lines changed

API.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ Return active connection for the given path
2828
*pwd* **(string)**: path (usually project root).
2929

3030

31-
**({string,string})** Connection tuple with ip and port or nil.
31+
**(string)** Id of the current connection for the path or nil.
3232

3333

3434
## `acid.connections.get(pwd)`

lua/acid/connections.lua

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -59,13 +59,12 @@ end
5959
connections.unselect = function(pwd)
6060
pwd = pwd_to_key(pwd)
6161

62-
-- TODO Potentially wrong
6362
connections.current[pwd] = nil
6463
end
6564

6665
--- Return active connection for the given path
6766
-- @tparam[opt] string pwd path (usually project root).
68-
-- @treturn {string,string} Connection tuple with ip and port or nil.
67+
-- @treturn string Id of the current connection for the path or nil.
6968
connections.peek = function(pwd)
7069
pwd = pwd_to_key(pwd or vim.api.nvim_call_function("getcwd", {}))
7170
return connections.current[pwd]
@@ -75,9 +74,7 @@ end
7574
-- @tparam string pwd path (usually project root).
7675
-- @treturn {string,string} Connection tuple with ip and port or nil.
7776
connections.get = function(pwd)
78-
pwd = pwd_to_key(pwd)
79-
80-
local ix = connections.current[pwd]
77+
local ix = connections.peek(pwd)
8178

8279
if ix == nil then
8380
return nil

0 commit comments

Comments
 (0)