From 7519af4f0fb54f4ef8b48ec4f18036069f18bf62 Mon Sep 17 00:00:00 2001 From: Sean Dewar Date: Fri, 25 Feb 2022 00:13:25 +0000 Subject: vim-patch:8.2.4438: crash on exit when using cmdline window Problem: Crash on exit when using cmdline window. Solution: Reset "cmdwin_type" before exiting. (closes vim/vim#9817) https://github.com/vim/vim/commit/ca0c1caa36823ea8e61184268d7337e79995352f Bram also went with the cmdwin_type = 0 solution, but putting it in read_error_exit isn't ideal and only fixes one specific variant of the bug, so don't port that change. Port the test only, but skip it as Nvim does not exit after stdin is exhausted. Using -es instead does exit, but read_error_exit does not run preserve_exit in that case, and does not have issues exiting even without resetting cmdwin_type. Note that the test has problems and is fixed in later patches. --- src/nvim/testdir/test_exit.vim | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'src/nvim/testdir/test_exit.vim') diff --git a/src/nvim/testdir/test_exit.vim b/src/nvim/testdir/test_exit.vim index bd3e9eb4d4..1d3722c718 100644 --- a/src/nvim/testdir/test_exit.vim +++ b/src/nvim/testdir/test_exit.vim @@ -1,6 +1,7 @@ " Tests for exiting Vim. source shared.vim +source check.vim func Test_exiting() let after =<< trim [CODE] @@ -109,4 +110,21 @@ func Test_exit_code() call delete('Xtestout') endfunc +func Test_exit_error_reading_input() + throw 'Skipped: Nvim does not exit after stdin is read' + + CheckNotGui + + call writefile([":au VimLeave * call writefile(['l = ' .. v:exiting], 'Xtestout')", ":tabnew\q:"], 'Xscript') + + " Nvim requires "-s -" to read stdin as Normal mode input + " if RunVim([], [], '< Xscript') + if RunVim([], [], '-s - < Xscript') + call assert_equal(['l = 1'], readfile('Xtestout')) + endif + call delete('Xscript') + call delete('Xtestout') +endfun + + " vim: shiftwidth=2 sts=2 expandtab -- cgit From fe5318293442aabdd4c7fd12ad892adcba1f80fb Mon Sep 17 00:00:00 2001 From: Sean Dewar Date: Fri, 25 Feb 2022 00:22:12 +0000 Subject: vim-patch:8.2.4442: test for error reading input fails on MS-Windows Problem: Test for error reading input fails on MS-Windows. Solution: Don't run the test on MS-Windows. https://github.com/vim/vim/commit/70b9e4f4c3a62e325fd16ac108bd12feb026ede5 --- src/nvim/testdir/test_exit.vim | 1 + 1 file changed, 1 insertion(+) (limited to 'src/nvim/testdir/test_exit.vim') diff --git a/src/nvim/testdir/test_exit.vim b/src/nvim/testdir/test_exit.vim index 1d3722c718..cbbd82d7d3 100644 --- a/src/nvim/testdir/test_exit.vim +++ b/src/nvim/testdir/test_exit.vim @@ -114,6 +114,7 @@ func Test_exit_error_reading_input() throw 'Skipped: Nvim does not exit after stdin is read' CheckNotGui + CheckNotMSWindows call writefile([":au VimLeave * call writefile(['l = ' .. v:exiting], 'Xtestout')", ":tabnew\q:"], 'Xscript') -- cgit From 0412dba45622eeb20e83d5458bab8714e2da0d2e Mon Sep 17 00:00:00 2001 From: Sean Dewar Date: Fri, 25 Feb 2022 00:20:35 +0000 Subject: vim-patch:8.2.4444: beep caused by test Problem: Beep caused by test. ASAN reports leaks. Solution: Do not put a NL at the end of the script. Make the text work on MS-Windows. Do not run the test with ASAN. https://github.com/vim/vim/commit/68eab67119734ea1efc7cef1287276d969f2713a The test is skipped, but cherry-pick CheckNotAsan from v8.2.2424 anyway. https://github.com/vim/vim/commit/97202d951685fc4d90085da676a90644cbf72571 --- src/nvim/testdir/test_exit.vim | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'src/nvim/testdir/test_exit.vim') diff --git a/src/nvim/testdir/test_exit.vim b/src/nvim/testdir/test_exit.vim index cbbd82d7d3..412802efb2 100644 --- a/src/nvim/testdir/test_exit.vim +++ b/src/nvim/testdir/test_exit.vim @@ -114,13 +114,14 @@ func Test_exit_error_reading_input() throw 'Skipped: Nvim does not exit after stdin is read' CheckNotGui - CheckNotMSWindows + " The early exit causes memory not to be freed somehow + CheckNotAsan - call writefile([":au VimLeave * call writefile(['l = ' .. v:exiting], 'Xtestout')", ":tabnew\q:"], 'Xscript') + call writefile([":au VimLeave * call writefile(['l = ' .. v:exiting], 'Xtestout')", ":tabnew", "q:"], 'Xscript', 'b') " Nvim requires "-s -" to read stdin as Normal mode input - " if RunVim([], [], '< Xscript') - if RunVim([], [], '-s - < Xscript') + " if RunVim([], [], ' Date: Fri, 25 Feb 2022 00:22:54 +0000 Subject: vim-patch:8.2.4445: exit test fails on MS-Windows anyway Problem: Exit test fails on MS-Windows anyway. Solution: Skip the test on MS-Windows. https://github.com/vim/vim/commit/29a9e6971849b4a9eabf14fee1130d51cecfbaa7 --- src/nvim/testdir/test_exit.vim | 1 + 1 file changed, 1 insertion(+) (limited to 'src/nvim/testdir/test_exit.vim') diff --git a/src/nvim/testdir/test_exit.vim b/src/nvim/testdir/test_exit.vim index 412802efb2..4e5da49adb 100644 --- a/src/nvim/testdir/test_exit.vim +++ b/src/nvim/testdir/test_exit.vim @@ -114,6 +114,7 @@ func Test_exit_error_reading_input() throw 'Skipped: Nvim does not exit after stdin is read' CheckNotGui + CheckNotMSWindows " The early exit causes memory not to be freed somehow CheckNotAsan -- cgit From 7e19c18a544b5f1f15cec0444385ddae80687a26 Mon Sep 17 00:00:00 2001 From: Sean Dewar Date: Fri, 25 Feb 2022 00:17:17 +0000 Subject: vim-patch:8.2.4454: resetting cmdwin_type only for one situation Problem: Resetting cmdwin_type only for one situation. Solution: Reset cmdwin_type before closing windows. (closes vim/vim#9822) https://github.com/vim/vim/commit/6a8b13614e5bcb233d20403ae9f008ccba152be3 Move the check to win_free_all to match Vim. --- src/nvim/testdir/test_exit.vim | 1 + 1 file changed, 1 insertion(+) (limited to 'src/nvim/testdir/test_exit.vim') diff --git a/src/nvim/testdir/test_exit.vim b/src/nvim/testdir/test_exit.vim index 4e5da49adb..befcaec2b2 100644 --- a/src/nvim/testdir/test_exit.vim +++ b/src/nvim/testdir/test_exit.vim @@ -123,6 +123,7 @@ func Test_exit_error_reading_input() " Nvim requires "-s -" to read stdin as Normal mode input " if RunVim([], [], '