Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 943bedf

Browse files
authored
event-loop: do not set CA_COMMAND_BUSY #9853
CA_COMMAND_BUSY in nv_event() was carried over from Vim nv_cursorhold() (ref: e5165ba). It prevents :startinsert from working during a RPC call, so remove it. Helped-by: glacambre <me@r4> closes #7254
1 parent 9da348b commit 943bedf

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

src/nvim/normal.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8001,7 +8001,6 @@ static void nv_event(cmdarg_T *cap)
80018001
// lists or dicts being used.
80028002
may_garbage_collect = false;
80038003
multiqueue_process_events(main_loop.events);
8004-
cap->retval |= CA_COMMAND_BUSY; // don't call edit() now
80058004
finish_op = false;
80068005
}
80078006

test/functional/api/vim_spec.lua

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,13 @@ describe('API', function()
5656
eq(2, eval('1+1'))
5757
end)
5858

59+
it('does not set CA_COMMAND_BUSY #7254', function()
60+
nvim('command', 'split')
61+
nvim('command', 'autocmd WinEnter * startinsert')
62+
nvim('command', 'wincmd w')
63+
eq({mode='i', blocking=false}, nvim("get_mode"))
64+
end)
65+
5966
describe('nvim_command', function()
6067
it('works', function()
6168
local fname = helpers.tmpname()
@@ -83,7 +90,7 @@ describe('API', function()
8390
end)
8491

8592
it('VimL execution error: fails with specific error', function()
86-
local status, rv = pcall(nvim, "command_output", "buffer 23487")
93+
local status, rv = pcall(nvim, "command", "buffer 23487")
8794
eq(false, status) -- nvim_command() failed.
8895
eq("E86: Buffer 23487 does not exist", string.match(rv, "E%d*:.*"))
8996
eq('', eval('v:errmsg')) -- v:errmsg was not updated.

0 commit comments

Comments
 (0)