diff options
author | Sean Dewar <seandewar@users.noreply.github.com> | 2022-02-21 10:55:36 +0000 |
---|---|---|
committer | Sean Dewar <seandewar@users.noreply.github.com> | 2022-03-14 13:10:20 +0000 |
commit | 880d3537d06ef067021c73bc361fa47ab8347992 (patch) | |
tree | b7ae27ab8ed4998babdd12a27b09e472887d85b1 /src/nvim/eval.c | |
parent | 895ca52e4c726fd6c2cf6fbbab0d392818337ce7 (diff) | |
download | rneovim-880d3537d06ef067021c73bc361fa47ab8347992.tar.gz rneovim-880d3537d06ef067021c73bc361fa47ab8347992.tar.bz2 rneovim-880d3537d06ef067021c73bc361fa47ab8347992.zip |
vim-patch:8.2.4428: crash when switching tabpage while in the cmdline window
Problem: Crash when switching tabpage while in the cmdline window.
Solution: Disallow switching tabpage when in the cmdline window.
https://github.com/vim/vim/commit/0f6e28f686dbb59ab3b562408ab9b2234797b9b1
Ensure cmdline window doesn't stop us from closing tabs with EXITFREE.
mem_free_all -> win_free_all -> tabpage_close -> ... -> goto_tabpage_tp
-> CHECK_CMDWIN can cause an infinite loop if Nvim is exited without using
standard methods such as :qa! and friends (e.g: killed via a signal).
This issue had caused the ASAN CI's functionaltests to timeout.
Cherry-pick Test_cmdwin_tabpage from v8.2.4463.
https://github.com/vim/vim/commit/38b85cb4d7216705058708bacbc25ab90cd61595
This bug was already fixed in Nvim. Note that g<Tab> inside cmdwin is already
tested for in tabnewentered_spec.lua anyway.
E492 is thrown after E11 when using ":norm" in assert_fails for some reason
(except after v8.2.1919, which isn't ported yet).
As v8.2.1183 isn't ported yet, so we cannot assert E11 directly.
Modify the test to check for E11 and E492 seperately; when v8.2.1183 is ported,
the assertion for E492 will fail and the changes can be reverted to match
upstream.
Remove redundant CHECK_CMDWIN from goto_tabpage; it's handled with text_locked()
and text_locked_msg() above:
vim-patch:8.2.4434: duplicate check for cmdline window
Problem: Duplicate check for cmdline window.
Solution: Remove the second check. (Sean Dewar, closes vim/vim#9816)
https://github.com/vim/vim/commit/16b51d26fe2cc3afb09afd439069220dea74581d
Diffstat (limited to 'src/nvim/eval.c')
-rw-r--r-- | src/nvim/eval.c | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/src/nvim/eval.c b/src/nvim/eval.c index 18b9039d60..b2ce15fd87 100644 --- a/src/nvim/eval.c +++ b/src/nvim/eval.c @@ -3257,9 +3257,7 @@ char_u *get_user_var_name(expand_T *xp, int idx) } // b: variables - // In cmdwin, the alternative buffer should be used. - hashtab_T *ht - = is_in_cmdwin() ? &prevwin->w_buffer->b_vars->dv_hashtab : &curbuf->b_vars->dv_hashtab; + const hashtab_T *ht = &prevwin_curwin()->w_buffer->b_vars->dv_hashtab; if (bdone < ht->ht_used) { if (bdone++ == 0) { hi = ht->ht_array; @@ -3273,8 +3271,7 @@ char_u *get_user_var_name(expand_T *xp, int idx) } // w: variables - // In cmdwin, the alternative window should be used. - ht = is_in_cmdwin() ? &prevwin->w_vars->dv_hashtab : &curwin->w_vars->dv_hashtab; + ht = &prevwin_curwin()->w_vars->dv_hashtab; if (wdone < ht->ht_used) { if (wdone++ == 0) { hi = ht->ht_array; |