diff options
author | lonerover <pathfinder1644@yahoo.com> | 2017-03-14 17:10:45 +0800 |
---|---|---|
committer | lonerover <pathfinder1644@yahoo.com> | 2017-03-18 18:10:23 +0800 |
commit | b65d5ff11bb8e095e7687c3e39fd006ef498b5b9 (patch) | |
tree | 63bb8b6ab1b80bd01d1feba0783bae8c445ea4a6 | |
parent | 700e13da82bde402bd0387917574efe6754420f4 (diff) | |
download | rneovim-b65d5ff11bb8e095e7687c3e39fd006ef498b5b9.tar.gz rneovim-b65d5ff11bb8e095e7687c3e39fd006ef498b5b9.tar.bz2 rneovim-b65d5ff11bb8e095e7687c3e39fd006ef498b5b9.zip |
vim-patch:7.4.2248
Problem: When cancelling the :ptjump prompt a preview window is opened for
a following command.
Solution: Reset g_do_tagpreview. (Hirohito Higashi) Add a test. Avoid that
the test runner gets stuck in trying to close a window.
https://github.com/vim/vim/commit/358308dd99abdd56c6540339e505585d8db7bdfe
-rw-r--r-- | src/nvim/tag.c | 3 | ||||
-rw-r--r-- | src/nvim/testdir/runtest.vim | 11 | ||||
-rw-r--r-- | src/nvim/testdir/test_tagjump.vim | 16 | ||||
-rw-r--r-- | src/nvim/version.c | 2 |
4 files changed, 29 insertions, 3 deletions
diff --git a/src/nvim/tag.c b/src/nvim/tag.c index 59f4c1e968..2c70f396a1 100644 --- a/src/nvim/tag.c +++ b/src/nvim/tag.c @@ -919,7 +919,8 @@ end_do_tag: /* Only store the new index when using the tagstack and it's valid. */ if (use_tagstack && tagstackidx <= curwin->w_tagstacklen) curwin->w_tagstackidx = tagstackidx; - postponed_split = 0; /* don't split next time */ + postponed_split = 0; // don't split next time + g_do_tagpreview = 0; // don't do tag preview next time return jumped_to_tag; } diff --git a/src/nvim/testdir/runtest.vim b/src/nvim/testdir/runtest.vim index 5299fec7c2..0403a53f9c 100644 --- a/src/nvim/testdir/runtest.vim +++ b/src/nvim/testdir/runtest.vim @@ -95,8 +95,17 @@ function RunTheTest(test) endif " Close any extra windows and make the current one not modified. - while winnr('$') > 1 + while 1 + let wincount = winnr('$') + if wincount == 1 + break + endif bwipe! + if wincount == winnr('$') + " Did not manage to close a window. + only! + break + endif endwhile set nomodified endfunc diff --git a/src/nvim/testdir/test_tagjump.vim b/src/nvim/testdir/test_tagjump.vim index b22bde8047..678ad0ada8 100644 --- a/src/nvim/testdir/test_tagjump.vim +++ b/src/nvim/testdir/test_tagjump.vim @@ -7,4 +7,20 @@ func Test_ptag_with_notagstack() set tagstack&vim endfunc +func Test_cancel_ptjump() + set tags=Xtags + call writefile(["!_TAG_FILE_ENCODING\tutf-8\t//", + \ "word\tfile1\tcmd1", + \ "word\tfile2\tcmd2"], + \ 'Xtags') + + only! + call feedkeys(":ptjump word\<CR>\<CR>", "xt") + help + call assert_equal(2, winnr('$')) + + call delete('Xtags') + quit +endfunc + " vim: shiftwidth=2 sts=2 expandtab diff --git a/src/nvim/version.c b/src/nvim/version.c index 4758e35f01..ab3ccdab3d 100644 --- a/src/nvim/version.c +++ b/src/nvim/version.c @@ -193,7 +193,7 @@ static int included_patches[] = { 2251, // 2250, 2249, - // 2248, + 2248, // 2247 NA // 2246, // 2245, |