From 348229b1d32010292013eee415c28926e2b7009b Mon Sep 17 00:00:00 2001 From: KunMing Xie Date: Wed, 2 Aug 2017 16:22:04 +0800 Subject: [PATCH 1/3] vim-patch:8.0.0133 (#7107) Problem: "2;'(" causes ml_get errors in an empty buffer. (Dominique Pelle) Solution: Check the cursor line earlier. https://github.com/vim/vim/commit/fe38b494fff56cd9b2fcaeef26a8fd7b6557d69c --- src/nvim/ex_docmd.c | 13 +++++++------ src/nvim/testdir/test_cmdline.vim | 7 +++++++ src/nvim/version.c | 2 +- 3 files changed, 15 insertions(+), 7 deletions(-) diff --git a/src/nvim/ex_docmd.c b/src/nvim/ex_docmd.c index 30156621d6..d1ce589db1 100644 --- a/src/nvim/ex_docmd.c +++ b/src/nvim/ex_docmd.c @@ -1665,11 +1665,15 @@ static char_u * do_one_cmd(char_u **cmdlinep, ea.addr_count++; if (*ea.cmd == ';') { - if (!ea.skip) + if (!ea.skip) { curwin->w_cursor.lnum = ea.line2; - } else if (*ea.cmd != ',') + // Don't leave the cursor on an illegal line (caused by ';') + check_cursor_lnum(); + } + } else if (*ea.cmd != ',') { break; - ++ea.cmd; + } + ea.cmd++; } /* One address given: set start and end lines */ @@ -1680,9 +1684,6 @@ static char_u * do_one_cmd(char_u **cmdlinep, ea.addr_count = 0; } - /* Don't leave the cursor on an illegal line (caused by ';') */ - check_cursor_lnum(); - /* * 5. Parse the command. */ diff --git a/src/nvim/testdir/test_cmdline.vim b/src/nvim/testdir/test_cmdline.vim index c3bfae1b7b..09f4b942ad 100644 --- a/src/nvim/testdir/test_cmdline.vim +++ b/src/nvim/testdir/test_cmdline.vim @@ -232,3 +232,10 @@ func Test_paste_in_cmdline() call assert_equal('"aaa a;b-c*d bbb', @:) bwipe! endfunc + +func Test_illegal_address() + new + 2;'( + 2;') + quit +endfunc diff --git a/src/nvim/version.c b/src/nvim/version.c index c68bc6351e..7f0b45e896 100644 --- a/src/nvim/version.c +++ b/src/nvim/version.c @@ -596,7 +596,7 @@ static const int included_patches[] = { 136, 135, // 134, - // 133, + 133, // 132, // 131, // 130 NA From 92101947febf304b009059aa3ef33863e071e9a0 Mon Sep 17 00:00:00 2001 From: "Justin M. Keyes" Date: Thu, 3 Aug 2017 09:57:12 +0200 Subject: [PATCH 2/3] test: job_spec.lua: disable shada in test instance --- test/functional/core/job_spec.lua | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/test/functional/core/job_spec.lua b/test/functional/core/job_spec.lua index b98169b067..54e56f7f41 100644 --- a/test/functional/core/job_spec.lua +++ b/test/functional/core/job_spec.lua @@ -9,6 +9,7 @@ local command = helpers.command local wait = helpers.wait local iswin = helpers.iswin local get_pathsep = helpers.get_pathsep +local nvim_set = helpers.nvim_set local Screen = require('test.functional.ui.screen') describe('jobs', function() @@ -669,9 +670,10 @@ describe("pty process teardown", function() if helpers.pending_win32(pending) then return end -- Use a nested nvim (in :term) to test without --headless. feed_command(":terminal '"..helpers.nvim_prog + .."' -u NONE -i NONE --cmd '"..nvim_set.."' " -- Use :term again in the _nested_ nvim to get a PTY process. -- Use `sleep` to simulate a long-running child of the PTY. - .."' +terminal +'!(sleep 300 &)' +qa") + .."+terminal +'!(sleep 300 &)' +qa") -- Exiting should terminate all descendants (PTY, its children, ...). screen:expect([[ From 678e87b90a08915d4fc16e3aada133f6482ba7a3 Mon Sep 17 00:00:00 2001 From: "Justin M. Keyes" Date: Fri, 4 Aug 2017 21:48:43 +0200 Subject: [PATCH 3/3] test/oldtest: avoid delete() on files used by a subprocess This should avoid the hangs observed in the TSAN build on travis CI. TODO: Find the root cause ... --- src/nvim/testdir/test49.vim | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/nvim/testdir/test49.vim b/src/nvim/testdir/test49.vim index 467abcd9b9..a0e170dea4 100644 --- a/src/nvim/testdir/test49.vim +++ b/src/nvim/testdir/test49.vim @@ -481,9 +481,12 @@ function! ExtraVim(...) bwipeout let g:Xpath = g:Xpath + sum + " FIXME(nvim): delete() of a file used by a subprocess hangs TSAN build on travis CI. + if !empty($TRAVIS) " Delete the extra script and the resultfile. call delete(extra_script) call delete(resultfile) + endif " Switch back to the buffer that was active when this function was entered. exec "buffer" current_buffnr