diff options
| author | Jan Edmund Lazo <janedmundlazo@hotmail.com> | 2018-06-21 09:59:14 -0400 |
|---|---|---|
| committer | Jan Edmund Lazo <janedmundlazo@hotmail.com> | 2018-06-21 12:50:30 -0400 |
| commit | bf61885cb45fcced4f5886f336460be4af8a8ba8 (patch) | |
| tree | 2852806953323960e6bc74ce50203af6b9a8dff0 /src/nvim/testdir | |
| parent | 7ae7da8fb9ab2e23ffc19000798ae27a2dee4e87 (diff) | |
| download | rneovim-bf61885cb45fcced4f5886f336460be4af8a8ba8.tar.gz rneovim-bf61885cb45fcced4f5886f336460be4af8a8ba8.tar.bz2 rneovim-bf61885cb45fcced4f5886f336460be4af8a8ba8.zip | |
vim-patch:8.0.0621: :stag does not respect 'switchbuf'
Problem: The ":stag" command does not respect 'switchbuf'.
Solution: Check 'switchbuf' for tag commands that may open a new window.
(Ingo Karkat, closes vim/vim#1681) Define macros for the return values
of getfile().
https://github.com/vim/vim/commit/8ad80dea089ffeb1a845199c013e9bb4be1cd22e
Diffstat (limited to 'src/nvim/testdir')
| -rw-r--r-- | src/nvim/testdir/test_tagjump.vim | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/src/nvim/testdir/test_tagjump.vim b/src/nvim/testdir/test_tagjump.vim index d5ce193bc6..dbab8d9e26 100644 --- a/src/nvim/testdir/test_tagjump.vim +++ b/src/nvim/testdir/test_tagjump.vim @@ -65,6 +65,48 @@ func Test_duplicate_tagjump() call delete('Xfile1') endfunc +func Test_tagjump_switchbuf() + set tags=Xtags + call writefile(["!_TAG_FILE_ENCODING\tutf-8\t//", + \ "second\tXfile1\t2", + \ "third\tXfile1\t3",], + \ 'Xtags') + call writefile(['first', 'second', 'third'], 'Xfile1') + + enew | only + set switchbuf= + stag second + call assert_equal(2, winnr('$')) + call assert_equal(2, line('.')) + stag third + call assert_equal(3, winnr('$')) + call assert_equal(3, line('.')) + + enew | only + set switchbuf=useopen + stag second + call assert_equal(2, winnr('$')) + call assert_equal(2, line('.')) + stag third + call assert_equal(2, winnr('$')) + call assert_equal(3, line('.')) + + enew | only + set switchbuf=usetab + tab stag second + call assert_equal(2, tabpagenr('$')) + call assert_equal(2, line('.')) + 1tabnext | stag third + call assert_equal(2, tabpagenr('$')) + call assert_equal(3, line('.')) + + tabclose! + enew | only + call delete('Xfile1') + call delete('Xtags') + set switchbuf&vim +endfunc + " Tests for [ CTRL-I and CTRL-W CTRL-I commands function Test_keyword_jump() call writefile(["#include Xinclude", "", |