mirror of
https://github.com/neovim/neovim.git
synced 2025-09-20 18:28:19 +00:00
vim-patch:8.2.0274: hang with combination of feedkeys(), Ex mode and :global
Problem: Hang with combination of feedkeys(), Ex mode and :global.
(Yegappan Lakshmanan)
Solution: Add the pending_exmode_active flag.
9e2bcb5d23
This commit is contained in:
@@ -7899,9 +7899,11 @@ void do_exedit(exarg_T *eap, win_T *old_curwin)
|
||||
need_wait_return = false;
|
||||
msg_scroll = 0;
|
||||
redraw_all_later(NOT_VALID);
|
||||
pending_exmode_active = true;
|
||||
|
||||
normal_enter(false, true);
|
||||
|
||||
pending_exmode_active = false;
|
||||
RedrawingDisabled = rd;
|
||||
no_wait_return = nwr;
|
||||
msg_scroll = ms;
|
||||
|
@@ -2475,6 +2475,11 @@ static int vgetorpeek(bool advance)
|
||||
}
|
||||
tc = c;
|
||||
|
||||
// return 0 in normal_check()
|
||||
if (pending_exmode_active) {
|
||||
exmode_active = true;
|
||||
}
|
||||
|
||||
// no chars to block abbreviations for
|
||||
typebuf.tb_no_abbr_cnt = 0;
|
||||
|
||||
|
@@ -636,6 +636,10 @@ EXTERN int motion_force INIT(=0); // motion force for pending operator
|
||||
|
||||
// Ex Mode (Q) state
|
||||
EXTERN bool exmode_active INIT(= false); // true if Ex mode is active
|
||||
|
||||
/// Flag set when normal_check() should return 0 when entering Ex mode.
|
||||
EXTERN bool pending_exmode_active INIT(= false);
|
||||
|
||||
EXTERN bool ex_no_reprint INIT(=false); // No need to print after z or p.
|
||||
|
||||
// 'inccommand' command preview state
|
||||
|
@@ -64,6 +64,14 @@ func Test_ex_mode()
|
||||
let &encoding = encoding_save
|
||||
endfunc
|
||||
|
||||
func Test_Ex_feedkeys()
|
||||
" this doesn't do anything useful, just check it doesn't hang
|
||||
new
|
||||
call setline(1, ["foo"])
|
||||
call feedkeys("Qg/foo/visual\<CR>", "xt")
|
||||
bwipe!
|
||||
endfunc
|
||||
|
||||
func Test_ex_mode_errors()
|
||||
" Not allowed to enter ex mode when text is locked
|
||||
au InsertCharPre <buffer> normal! gQ<CR>
|
||||
|
Reference in New Issue
Block a user