mirror of
https://github.com/neovim/neovim.git
synced 2025-09-08 12:28:18 +00:00
event-loop: do not set CA_COMMAND_BUSY #9853
CA_COMMAND_BUSY in nv_event() was carried over from Vim nv_cursorhold()
(ref: e5165bae11
). It prevents :startinsert from working during a RPC
call, so remove it.
Helped-by: glacambre <me@r4>
closes #7254
This commit is contained in:
@@ -8001,7 +8001,6 @@ static void nv_event(cmdarg_T *cap)
|
|||||||
// lists or dicts being used.
|
// lists or dicts being used.
|
||||||
may_garbage_collect = false;
|
may_garbage_collect = false;
|
||||||
multiqueue_process_events(main_loop.events);
|
multiqueue_process_events(main_loop.events);
|
||||||
cap->retval |= CA_COMMAND_BUSY; // don't call edit() now
|
|
||||||
finish_op = false;
|
finish_op = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -56,6 +56,13 @@ describe('API', function()
|
|||||||
eq(2, eval('1+1'))
|
eq(2, eval('1+1'))
|
||||||
end)
|
end)
|
||||||
|
|
||||||
|
it('does not set CA_COMMAND_BUSY #7254', function()
|
||||||
|
nvim('command', 'split')
|
||||||
|
nvim('command', 'autocmd WinEnter * startinsert')
|
||||||
|
nvim('command', 'wincmd w')
|
||||||
|
eq({mode='i', blocking=false}, nvim("get_mode"))
|
||||||
|
end)
|
||||||
|
|
||||||
describe('nvim_command', function()
|
describe('nvim_command', function()
|
||||||
it('works', function()
|
it('works', function()
|
||||||
local fname = helpers.tmpname()
|
local fname = helpers.tmpname()
|
||||||
@@ -83,7 +90,7 @@ describe('API', function()
|
|||||||
end)
|
end)
|
||||||
|
|
||||||
it('VimL execution error: fails with specific error', function()
|
it('VimL execution error: fails with specific error', function()
|
||||||
local status, rv = pcall(nvim, "command_output", "buffer 23487")
|
local status, rv = pcall(nvim, "command", "buffer 23487")
|
||||||
eq(false, status) -- nvim_command() failed.
|
eq(false, status) -- nvim_command() failed.
|
||||||
eq("E86: Buffer 23487 does not exist", string.match(rv, "E%d*:.*"))
|
eq("E86: Buffer 23487 does not exist", string.match(rv, "E%d*:.*"))
|
||||||
eq('', eval('v:errmsg')) -- v:errmsg was not updated.
|
eq('', eval('v:errmsg')) -- v:errmsg was not updated.
|
||||||
|
Reference in New Issue
Block a user