File tree 4 files changed +21
-1
lines changed 4 files changed +21
-1
lines changed Original file line number Diff line number Diff line change @@ -22,6 +22,15 @@ Dissociates the connection for the given path
22
22
pwd ** (string)** : path (usually project root).
23
23
24
24
25
+ ## ` acid.connections.peek([pwd]) `
26
+ Return active connection for the given path
27
+
28
+ * pwd* ** (string)** : path (usually project root).
29
+
30
+
31
+ ** ({string,string})** Connection tuple with ip and port or nil.
32
+
33
+
25
34
## ` acid.connections.get(pwd) `
26
35
Return active connection for the given path
27
36
Original file line number Diff line number Diff line change @@ -63,6 +63,14 @@ connections.unselect = function(pwd)
63
63
connections .current [pwd ] = nil
64
64
end
65
65
66
+ --- Return active connection for the given path
67
+ -- @tparam [opt] string pwd path (usually project root).
68
+ -- @treturn {string,string} Connection tuple with ip and port or nil.
69
+ connections .peek = function (pwd )
70
+ pwd = pwd_to_key (pwd or vim .api .nvim_call_function (" getcwd" , {}))
71
+ return connections .current [pwd ]
72
+ end
73
+
66
74
--- Return active connection for the given path
67
75
-- @tparam string pwd path (usually project root).
68
76
-- @treturn {string,string} Connection tuple with ip and port or nil.
Original file line number Diff line number Diff line change 6
6
local core = require (" acid.core" )
7
7
local connections = require (" acid.connections" )
8
8
local utils = require (" acid.utils" )
9
+ local sessions = require (" acid.sessions" )
9
10
10
11
local acid = {}
11
12
27
28
-- @param cmd A command (op + payload + handler) to be executed.
28
29
-- @param conn A connection where this command will be run.
29
30
acid .run = function (cmd , conn )
30
- return core .send (conn , cmd :build ())
31
+ local filtered = cmd :update_payload (sessions .filter )
32
+ return core .send (conn , filtered :build ())
31
33
end
32
34
33
35
Original file line number Diff line number Diff line change @@ -90,6 +90,7 @@ augroup acid
90
90
autocmd !
91
91
autocmd BufWritePost *.clj call s: require ()
92
92
93
+ autocmd User AcidConnected lua require (" acid.sessions" ).new_session ()
93
94
autocmd User AcidConnected lua require (" acid.features" ).preload ()
94
95
autocmd User AcidConnected lua require (" acid.features" ).load_all_nss ()
95
96
You can’t perform that action at this time.
0 commit comments