diff options
| author | Justin M. Keyes <justinkz@gmail.com> | 2026-06-29 21:47:09 +0200 |
|---|---|---|
| committer | Justin M. Keyes <justinkz@gmail.com> | 2026-06-29 22:38:29 +0200 |
| commit | 52566856611ef9ff54a1cff2bdbcfedf4e72d95c (patch) | |
| tree | e108bdeb61a00e7365749b6ab04113c3ab034d4b /test/functional/vimscript/api_functions_spec.lua | |
| parent | d6a1b4110a87bf733389a73a4a4e900276255bd9 (diff) | |
| download | rneovim-52566856611ef9ff54a1cff2bdbcfedf4e72d95c.tar.gz rneovim-52566856611ef9ff54a1cff2bdbcfedf4e72d95c.tar.bz2 rneovim-52566856611ef9ff54a1cff2bdbcfedf4e72d95c.zip | |
feat(cmdwin): drop CHECK_CMDWIN
Allow window navigation/creation even while cmdwin is alive! 😱
Diffstat (limited to 'test/functional/vimscript/api_functions_spec.lua')
| -rw-r--r-- | test/functional/vimscript/api_functions_spec.lua | 17 |
1 files changed, 7 insertions, 10 deletions
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 <buffer> ++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; <CR> 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. |