From 52566856611ef9ff54a1cff2bdbcfedf4e72d95c Mon Sep 17 00:00:00 2001 From: "Justin M. Keyes" Date: Mon, 29 Jun 2026 21:47:09 +0200 Subject: feat(cmdwin): drop CHECK_CMDWIN MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Allow window navigation/creation even while cmdwin is alive! 😱 --- test/functional/vimscript/api_functions_spec.lua | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) (limited to 'test/functional/vimscript/api_functions_spec.lua') diff --git a/test/functional/vimscript/api_functions_spec.lua b/test/functional/vimscript/api_functions_spec.lua index b341c191d6..cc08108d15 100644 --- a/test/functional/vimscript/api_functions_spec.lua +++ b/test/functional/vimscript/api_functions_spec.lua @@ -60,7 +60,7 @@ describe('eval-API', function() eq('Vim(call):E5555: API call: Invalid buffer id: 17', err) end) - it('cannot change text or window if textlocked', function() + it('cannot change text or window if textlock', function() command('autocmd TextYankPost ++once call nvim_buf_set_lines(0, 0, -1, v:false, [])') matches( 'Vim%(call%):E5555: API call: E565: Not allowed to change text or change window$', @@ -90,19 +90,16 @@ describe('eval-API', function() api.nvim_get_vvar('errmsg') ) - -- cmdwin behavior (changed since #40312). + -- cmdwin (#40312, #40484): E11 "Invalid in command-line window" restriction was removed. local old_win = api.nvim_get_current_win() feed('q:') local cmdwin_win = api.nvim_get_current_win() - eq( - 'Vim:E11: Invalid in command-line window; executes, CTRL-C quits', - pcall_err(api.nvim_set_current_win, old_win) - ) + neq(old_win, cmdwin_win) + -- Switching to another window from the cmdwin now works (previously E11). + api.nvim_set_current_win(old_win) eq(old_win, api.nvim_get_current_win()) - -- TODO(justinmk): awkward: E11 is raised but the focus switch happens anyway; inherited bug in - -- goto_tabpage_win (calls win_enter unconditionally even when goto_tabpage_tp's CHECK_CMDWIN - -- emsg'd). We should probably just remove CHECK_CMDWIN from goto_tabpage_tp. #40407 - pcall(api.nvim_set_current_win, cmdwin_win) + -- ...and back into the cmdwin. + api.nvim_set_current_win(cmdwin_win) eq(cmdwin_win, api.nvim_get_current_win()) -- nvim_buf_set_lines() in the cmdwin buffer is OK. -- cgit