diff options
author | Sean Dewar <seandewar@users.noreply.github.com> | 2023-07-24 14:19:01 +0100 |
---|---|---|
committer | Sean Dewar <seandewar@users.noreply.github.com> | 2023-07-26 20:44:46 +0100 |
commit | 472271199e483d3f23d62c272b20c5290eec5474 (patch) | |
tree | 9965e5a35f07a77365d48148c251a52afd2b4d8c /test/functional/vimscript/api_functions_spec.lua | |
parent | 5d921e28c1cc33eced22bbfa823460ca241e3dc1 (diff) | |
download | rneovim-472271199e483d3f23d62c272b20c5290eec5474.tar.gz rneovim-472271199e483d3f23d62c272b20c5290eec5474.tar.bz2 rneovim-472271199e483d3f23d62c272b20c5290eec5474.zip |
feat(api): allow win_hide to close cmdwin or non-previous windows
This aligns its behaviour better with `nvim_win_close`.
Note that `:hide` is actually incapable of closing the cmdwin, unlike `:close`
and `:quit`, so this is a bit of a difference in behaviour.
Diffstat (limited to 'test/functional/vimscript/api_functions_spec.lua')
-rw-r--r-- | test/functional/vimscript/api_functions_spec.lua | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/test/functional/vimscript/api_functions_spec.lua b/test/functional/vimscript/api_functions_spec.lua index 6548548a9e..0a7e7c1137 100644 --- a/test/functional/vimscript/api_functions_spec.lua +++ b/test/functional/vimscript/api_functions_spec.lua @@ -73,9 +73,10 @@ describe('eval-API', function() -- Some functions checking textlock (usually those that may change the current window or buffer) -- also ought to not be usable in the cmdwin. + local old_win = meths.get_current_win() feed("q:") eq('E11: Invalid in command-line window; <CR> executes, CTRL-C quits', - pcall_err(meths.win_hide, 0)) + pcall_err(meths.set_current_win, old_win)) -- But others, like nvim_buf_set_lines(), which just changes text, is OK. curbufmeths.set_lines(0, -1, 1, {"wow!"}) |