@@ -64,7 +64,8 @@ local build_cmd = function(obj)
6464 end
6565
6666 if obj .alias ~= nil then
67- table.insert (opts , 4 , obj .alias )
67+ table.insert (opts , 4 , " -C" .. table.concat (obj .alias , " " ))
68+ table.insert (opts , 4 , " -R" .. table.concat (obj .alias , " " ))
6869 end
6970
7071 if obj .port ~= nil then
@@ -89,7 +90,6 @@ local build_cmd = function(obj)
8990 return opts
9091end
9192
92-
9393nrepl .cache = {}
9494
9595--- Default middlewares that will be used by the nrepl server
@@ -100,9 +100,10 @@ nrepl.default_middlewares = {'nrepl/nrepl', 'cider/cider-nrepl', 'refactor-nrepl
100100-- @tparam table obj Configuration for the nrepl process to be spawn
101101-- @tparam [opt] string obj.pwd Path where the nrepl process will be started
102102-- @tparam [opt] table obj.middlewares List of middlewares.
103- -- @tparam [opt] string obj.alias alias on the local deps.edn
103+ -- @tparam [opt] string obj.alias aliases on the local deps.edn
104104-- @tparam [opt] string obj.connect -c parameter for the nrepl process
105105-- @tparam [opt] string obj.bind -b parameter for the nrepl process
106+ -- @tparam [opt] boolean obj.skip_autocmd don't fire an autocmd after starting this repl
106107-- @treturn boolean Whether it was possible to spawn a nrepl process
107108nrepl .start = function (obj )
108109 local pwd = obj .pwd or vim .api .nvim_call_function (" getcwd" , {})
@@ -141,6 +142,7 @@ nrepl.start = function(obj)
141142 local conn = {bind , obj .port }
142143
143144 nrepl .cache [pwd ] = {
145+ skip_autocmd = obj .skip_autocmd ,
144146 job = ret ,
145147 addr = conn
146148 }
@@ -178,9 +180,11 @@ nrepl.handle = {
178180 local port = ln :match (" %d+" )
179181 connections .store [opts .ix ][2 ] = port
180182 connections .select (opts .pwd , opts .ix )
181- log .msg (" Connected on port" , tostring (port ))
182- vim .api .nvim_command (" doautocmd User AcidConnected" )
183183 pending [ch ] = nil
184+ if not nrepl .cache [opts .pwd ].skip_autocmd then
185+ log .msg (" Connected on port" , tostring (port ))
186+ vim .api .nvim_command (" doautocmd User AcidConnected" )
187+ end
184188 end
185189 end
186190 end
0 commit comments