Skip to content

Commit 358308d

Browse files
committed
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.
1 parent b58fe45 commit 358308d

File tree

4 files changed

+31
-1
lines changed

4 files changed

+31
-1
lines changed

src/tag.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1078,6 +1078,9 @@ do_tag(
10781078
curwin->w_tagstackidx = tagstackidx;
10791079
#ifdef FEAT_WINDOWS
10801080
postponed_split = 0; /* don't split next time */
1081+
# ifdef FEAT_QUICKFIX
1082+
g_do_tagpreview = 0; /* don't do tag preview next time */
1083+
# endif
10811084
#endif
10821085

10831086
#ifdef FEAT_CSCOPE

src/testdir/runtest.vim

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,8 +105,17 @@ function RunTheTest(test)
105105
endif
106106

107107
" Close any extra windows and make the current one not modified.
108-
while winnr('$') > 1
108+
while 1
109+
let wincount = winnr('$')
110+
if wincount == 1
111+
break
112+
endif
109113
bwipe!
114+
if wincount == winnr('$')
115+
" Did not manage to close a window.
116+
only!
117+
break
118+
endif
110119
endwhile
111120
set nomodified
112121
endfunc

src/testdir/test_tagjump.vim

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,20 @@ func Test_ptag_with_notagstack()
77
set tagstack&vim
88
endfunc
99

10+
func Test_cancel_ptjump()
11+
set tags=Xtags
12+
call writefile(["!_TAG_FILE_ENCODING\tutf-8\t//",
13+
\ "word\tfile1\tcmd1",
14+
\ "word\tfile2\tcmd2"],
15+
\ 'Xtags')
16+
17+
only!
18+
call feedkeys(":ptjump word\<CR>\<CR>", "xt")
19+
help
20+
call assert_equal(2, winnr('$'))
21+
22+
call delete('Xtags')
23+
quit
24+
endfunc
25+
1026
" vim: shiftwidth=2 sts=2 expandtab

src/version.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -763,6 +763,8 @@ static char *(features[]) =
763763

764764
static int included_patches[] =
765765
{ /* Add new patch number below this line */
766+
/**/
767+
2248,
766768
/**/
767769
2247,
768770
/**/

0 commit comments

Comments
 (0)