From 664efa497e4e3d79d2e4ab486acbf1471b2389b0 Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Thu, 7 Jul 2022 04:47:18 +0800 Subject: vim-patch:8.2.0614: get ml_get error when deleting a line in 'completefunc' (#19244) Problem: Get ml_get error when deleting a line in 'completefunc'. (Yegappan Lakshmanan) Solution: Lock the text while evaluating 'completefunc'. https://github.com/vim/vim/commit/ff06f283e3e4b3ec43012dd3b83f8454c98f6639 Fix a mistake in the porting of patch 8.1.0098. Cherry-pick Test_run_excmd_with_text_locked() from patch 8.2.0270. Cherry-pick test_gf.vim changes from patch 8.2.0369. Cherry-pick message change from later patches. --- src/nvim/testdir/test_excmd.vim | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'src/nvim/testdir/test_excmd.vim') diff --git a/src/nvim/testdir/test_excmd.vim b/src/nvim/testdir/test_excmd.vim index 7dde8a0439..b3052abb24 100644 --- a/src/nvim/testdir/test_excmd.vim +++ b/src/nvim/testdir/test_excmd.vim @@ -401,6 +401,30 @@ func Test_winsize_cmd() " Actually changing the window size would be flaky. endfunc +" Test for running Ex commands when text is locked. +" e in the command line is used to lock the text +func Test_run_excmd_with_text_locked() + " :quit + let cmd = ":\eexecute('quit')\\" + call assert_fails("call feedkeys(cmd, 'xt')", 'E565:') + + " :qall + let cmd = ":\eexecute('qall')\\" + call assert_fails("call feedkeys(cmd, 'xt')", 'E565:') + + " :exit + let cmd = ":\eexecute('exit')\\" + call assert_fails("call feedkeys(cmd, 'xt')", 'E565:') + + " :close - should be ignored + new + let cmd = ":\eexecute('close')\\" + call assert_equal(2, winnr('$')) + close + + call assert_fails("call feedkeys(\":\=execute('bnext')\\", 'xt')", 'E565:') +endfunc + func Test_not_break_expression_register() call setreg('=', '1+1') if 0 -- cgit