Skip to content

Commit 6057748

Browse files
committed
patch 8.2.2568: second time a preview popup is opened highlight is not set
Problem: Second time a preview popup is opened highlight is not set. (Gabriel Dupras) Solution: Apply 'previewpopup' after getting the file. (closes #7928)
1 parent 6c3843c commit 6057748

7 files changed

Lines changed: 36 additions & 26 deletions

src/tag.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3510,6 +3510,11 @@ jumpto_tag(
35103510
// Save value of no_hlsearch, jumping to a tag is not a real search
35113511
save_no_hlsearch = no_hlsearch;
35123512
#endif
3513+
#ifdef FEAT_PROP_POPUP
3514+
// getfile() may have cleared options, apply 'previewpopup' again.
3515+
if (g_do_tagpreview != 0 && *p_pvp != NUL)
3516+
parse_previewpopup(curwin);
3517+
#endif
35133518

35143519
/*
35153520
* If 'cpoptions' contains 't', store the search pattern for the "n"

src/testdir/dumps/Test_popupwin_previewpopup_2.dump

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
|o+0&#ffffff0|n|e| @71
22
|#|i|n|c|l|u|d|e| |"|X|h|e|a|d|e|r|.|h|"| @54
33
|t|h|r|e@1| @69
4-
|f|o|u|r| @3|╔+0#0000001#ffd7ff255| |X|t|a|g|f|i|l|e| |═@30|X| +0#0000000#ffffff0@23
5-
|f|i|v|e| @3|║+0#0000001#ffd7ff255|2|7| @37| +0#0000000#a8a8a8255|║+0#0000001#ffd7ff255| +0#0000000#ffffff0@23
6-
|s|i|x| @4|║+0#0000001#ffd7ff255|t|h|i|s| |i|s| |a|n|o|t|h|e|r| |p|l|a|c|e| @18| +0#0000000#a8a8a8255|║+0#0000001#ffd7ff255| +0#0000000#ffffff0@23
7-
|s|e|v|e|n| @2|║+0#0000001#ffd7ff255|2|9| @37| +0#0000000#0000001|║+0#0000001#ffd7ff255| +0#0000000#ffffff0@23
8-
|f|i|n|d| |t|h|e|║+0#0000001#ffd7ff255|3|0| @37| +0#0000000#a8a8a8255|║+0#0000001#ffd7ff255| +0#0000000#ffffff0@23
9-
|n|i|n|e| @3|╚+0#0000001#ffd7ff255|═@40|⇲| +0#0000000#ffffff0@23
4+
|f|o|u|r| @3|╔+0&#afffff255| |X|t|a|g|f|i|l|e| |═@30|X| +0&#ffffff0@23
5+
|f|i|v|e| @3|║+0&#afffff255|2|7| @37| +0&#a8a8a8255|║+0&#afffff255| +0&#ffffff0@23
6+
|s|i|x| @4|║+0&#afffff255|t|h|i|s| |i|s| |a|n|o|t|h|e|r| |p|l|a|c|e| @18| +0&#a8a8a8255|║+0&#afffff255| +0&#ffffff0@23
7+
|s|e|v|e|n| @2|║+0&#afffff255|2|9| @37| +0&#0000001|║+0&#afffff255| +0&#ffffff0@23
8+
|f|i|n|d| |t|h|e|║+0&#afffff255|3|0| @37| +0&#a8a8a8255|║+0&#afffff255| +0&#ffffff0@23
9+
|n|i|n|e| @3|╚+0&#afffff255|═@40|⇲| +0&#ffffff0@23
1010
|t|h|i|s| |i|s| >a|n|o|t|h|e|r| |w|o|r|d| @54
1111
|v|e|r|y| |l|o|n|g| |l|i|n|e| |w|h|e|r|e| |t|h|e| |w|o|r|d| |i|s| |a|l|s|o| |a|n|o|t|h|e|r| @29
1212
|~+0#4040ff13&| @73

src/testdir/dumps/Test_popupwin_previewpopup_3.dump

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
|o+0&#ffffff0|n|e| @71
22
|#|i|n|c|l|u|d|e| |"|X|h|e|a|d|e|r|.|h|"| @54
33
|t|h|r|e@1| @69
4-
|f|o|u|r| @9|╔+0#0000001#ffd7ff255| |X|t|a|g|f|i|l|e| |═@30|X| +0#0000000#ffffff0@17
5-
|f|i|v|e| @9|║+0#0000001#ffd7ff255|2|7| @37| +0#0000000#a8a8a8255|║+0#0000001#ffd7ff255| +0#0000000#ffffff0@17
6-
|s|i|x| @10|║+0#0000001#ffd7ff255|t|h|i|s| |i|s| |a|n|o|t|h|e|r| |p|l|a|c|e| @18| +0#0000000#a8a8a8255|║+0#0000001#ffd7ff255| +0#0000000#ffffff0@17
7-
|s|e|v|e|n| @8|║+0#0000001#ffd7ff255|2|9| @37| +0#0000000#0000001|║+0#0000001#ffd7ff255| +0#0000000#ffffff0@17
8-
|f|i|n|d| |t|h|e|w|o|r|d| |s|║+0#0000001#ffd7ff255|3|0| @37| +0#0000000#a8a8a8255|║+0#0000001#ffd7ff255| +0#0000000#ffffff0@17
9-
|n|i|n|e| @9|╚+0#0000001#ffd7ff255|═@40|⇲| +0#0000000#ffffff0@17
4+
|f|o|u|r| @9|╔+0&#afffff255| |X|t|a|g|f|i|l|e| |═@30|X| +0&#ffffff0@17
5+
|f|i|v|e| @9|║+0&#afffff255|2|7| @37| +0&#a8a8a8255|║+0&#afffff255| +0&#ffffff0@17
6+
|s|i|x| @10|║+0&#afffff255|t|h|i|s| |i|s| |a|n|o|t|h|e|r| |p|l|a|c|e| @18| +0&#a8a8a8255|║+0&#afffff255| +0&#ffffff0@17
7+
|s|e|v|e|n| @8|║+0&#afffff255|2|9| @37| +0&#0000001|║+0&#afffff255| +0&#ffffff0@17
8+
|f|i|n|d| |t|h|e|w|o|r|d| |s|║+0&#afffff255|3|0| @37| +0&#a8a8a8255|║+0&#afffff255| +0&#ffffff0@17
9+
|n|i|n|e| @9|╚+0&#afffff255|═@40|⇲| +0&#ffffff0@17
1010
|t|h|i|s| |i|s| >a|n|o|t|h|e|r| |w|o|r|d| @54
1111
|v|e|r|y| |l|o|n|g| |l|i|n|e| |w|h|e|r|e| |t|h|e| |w|o|r|d| |i|s| |a|l|s|o| |a|n|o|t|h|e|r| @29
1212
|~+0#4040ff13&| @73

src/testdir/dumps/Test_popupwin_previewpopup_4.dump

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@
22
|#|i|n|c|l|u|d|e| |"|X|h|e|a|d|e|r|.|h|"| @54
33
|t|h|r|e@1| @69
44
|f|o|u|r| @70
5-
|f|i|v|e| @28|╔+0#0000001#ffd7ff255| |X|t|a|g|f|i|l|e| |═@29|X
6-
|s+0#0000000#ffffff0|i|x| @29|║+0#0000001#ffd7ff255|2|7| @36| +0#0000000#a8a8a8255|║+0#0000001#ffd7ff255
7-
|s+0#0000000#ffffff0|e|v|e|n| @27|║+0#0000001#ffd7ff255|t|h|i|s| |i|s| |a|n|o|t|h|e|r| |p|l|a|c|e| @17| +0#0000000#a8a8a8255|║+0#0000001#ffd7ff255
8-
|f+0#0000000#ffffff0|i|n|d| |t|h|e|w|o|r|d| |s|o|m|e|w|h|e|r|e| @10|║+0#0000001#ffd7ff255|2|9| @36| +0#0000000#0000001|║+0#0000001#ffd7ff255
9-
|n+0#0000000#ffffff0|i|n|e| @28|║+0#0000001#ffd7ff255|3|0| @36| +0#0000000#a8a8a8255|║+0#0000001#ffd7ff255
10-
|t+0#0000000#ffffff0|h|i|s| |i|s| |a|n|o|t|h|e|r| |w|o|r|d| @12|╚+0#0000001#ffd7ff255|═@39|⇲
11-
|v+0#0000000#ffffff0|e|r|y| |l|o|n|g| |l|i|n|e| |w|h|e|r|e| |t|h|e| |w|o|r|d| |i|s| |a|l|s|o| >a|n|o|t|h|e|r| @29
5+
|f|i|v|e| @28|╔+0&#afffff255| |X|t|a|g|f|i|l|e| |═@29|X
6+
|s+0&#ffffff0|i|x| @29|║+0&#afffff255|2|7| @36| +0&#a8a8a8255|║+0&#afffff255
7+
|s+0&#ffffff0|e|v|e|n| @27|║+0&#afffff255|t|h|i|s| |i|s| |a|n|o|t|h|e|r| |p|l|a|c|e| @17| +0&#a8a8a8255|║+0&#afffff255
8+
|f+0&#ffffff0|i|n|d| |t|h|e|w|o|r|d| |s|o|m|e|w|h|e|r|e| @10|║+0&#afffff255|2|9| @36| +0&#0000001|║+0&#afffff255
9+
|n+0&#ffffff0|i|n|e| @28|║+0&#afffff255|3|0| @36| +0&#a8a8a8255|║+0&#afffff255
10+
|t+0&#ffffff0|h|i|s| |i|s| |a|n|o|t|h|e|r| |w|o|r|d| @12|╚+0&#afffff255|═@39|⇲
11+
|v+0&#ffffff0|e|r|y| |l|o|n|g| |l|i|n|e| |w|h|e|r|e| |t|h|e| |w|o|r|d| |i|s| |a|l|s|o| >a|n|o|t|h|e|r| @29
1212
|~+0#4040ff13&| @73
1313
|~| @73
1414
|/+0#0000000&|a|n|o|t|h|e|r| @48|1@1|,|3|9| @8|A|l@1|

src/testdir/dumps/Test_popupwin_previewpopup_5.dump

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@
22
|#|i|n|c|l|u|d|e| |"|X|h|e|a|d|e|r|.|h|"| @54
33
|t|h|r|e@1| @69
44
|f|o|u|r| @70
5-
|f|i|v|e| @28|╔+0#0000001#ffd7ff255| |t|e|s|t|d|i|r|/|X|t|a|g|f|i|l|e| |═@21|X
6-
|s+0#0000000#ffffff0|i|x| @29|║+0#0000001#ffd7ff255|2|7| @36| +0#0000000#a8a8a8255|║+0#0000001#ffd7ff255
7-
|s+0#0000000#ffffff0|e|v|e|n| @27|║+0#0000001#ffd7ff255|t|h|i|s| |i|s| |a|n|o|t|h|e|r| |p|l|a|c|e| @17| +0#0000000#a8a8a8255|║+0#0000001#ffd7ff255
8-
|f+0#0000000#ffffff0|i|n|d| |t|h|e|w|o|r|d| |s|o|m|e|w|h|e|r|e| @10|║+0#0000001#ffd7ff255|2|9| @36| +0#0000000#0000001|║+0#0000001#ffd7ff255
9-
|n+0#0000000#ffffff0|i|n|e| @28|║+0#0000001#ffd7ff255|3|0| @36| +0#0000000#a8a8a8255|║+0#0000001#ffd7ff255
10-
|t+0#0000000#ffffff0|h|i|s| |i|s| |a|n|o|t|h|e|r| |w|o|r|d| @12|╚+0#0000001#ffd7ff255|═@39|⇲
11-
|v+0#0000000#ffffff0|e|r|y| |l|o|n|g| |l|i|n|e| |w|h|e|r|e| |t|h|e| |w|o|r|d| |i|s| |a|l|s|o| >a|n|o|t|h|e|r| @29
5+
|f|i|v|e| @28|╔+0&#afffff255| |t|e|s|t|d|i|r|/|X|t|a|g|f|i|l|e| |═@21|X
6+
|s+0&#ffffff0|i|x| @29|║+0&#afffff255|2|7| @36| +0&#a8a8a8255|║+0&#afffff255
7+
|s+0&#ffffff0|e|v|e|n| @27|║+0&#afffff255|t|h|i|s| |i|s| |a|n|o|t|h|e|r| |p|l|a|c|e| @17| +0&#a8a8a8255|║+0&#afffff255
8+
|f+0&#ffffff0|i|n|d| |t|h|e|w|o|r|d| |s|o|m|e|w|h|e|r|e| @10|║+0&#afffff255|2|9| @36| +0&#0000001|║+0&#afffff255
9+
|n+0&#ffffff0|i|n|e| @28|║+0&#afffff255|3|0| @36| +0&#a8a8a8255|║+0&#afffff255
10+
|t+0&#ffffff0|h|i|s| |i|s| |a|n|o|t|h|e|r| |w|o|r|d| @12|╚+0&#afffff255|═@39|⇲
11+
|v+0&#ffffff0|e|r|y| |l|o|n|g| |l|i|n|e| |w|h|e|r|e| |t|h|e| |w|o|r|d| |i|s| |a|l|s|o| >a|n|o|t|h|e|r| @29
1212
|~+0#4040ff13&| @73
1313
|~| @73
1414
|:+0#0000000&| @55|1@1|,|3|9| @8|A|l@1|

src/testdir/test_popupwin.vim

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3159,6 +3159,7 @@ func Test_previewpopup()
31593159
\ 'this is another word',
31603160
\ 'very long line where the word is also another'])
31613161
set previewpopup=height:4,width:40
3162+
hi OtherColor ctermbg=lightcyan guibg=lightcyan
31623163
set path=.
31633164
END
31643165
call writefile(lines, 'XtestPreviewPopup')
@@ -3168,6 +3169,7 @@ func Test_previewpopup()
31683169
call term_sendkeys(buf, ":\<CR>")
31693170
call VerifyScreenDump(buf, 'Test_popupwin_previewpopup_1', {})
31703171

3172+
call term_sendkeys(buf, ":set previewpopup+=highlight:OtherColor\<CR>")
31713173
call term_sendkeys(buf, "/another\<CR>\<C-W>}")
31723174
call VerifyScreenDump(buf, 'Test_popupwin_previewpopup_2', {})
31733175

@@ -3182,6 +3184,7 @@ func Test_previewpopup()
31823184
call VerifyScreenDump(buf, 'Test_popupwin_previewpopup_5', {})
31833185
call term_sendkeys(buf, ":silent cd testdir\<CR>")
31843186

3187+
call term_sendkeys(buf, ":set previewpopup-=highlight:OtherColor\<CR>")
31853188
call term_sendkeys(buf, ":pclose\<CR>")
31863189
call term_sendkeys(buf, ":\<BS>")
31873190
call VerifyScreenDump(buf, 'Test_popupwin_previewpopup_6', {})

src/version.c

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

751751
static int included_patches[] =
752752
{ /* Add new patch number below this line */
753+
/**/
754+
2568,
753755
/**/
754756
2567,
755757
/**/

0 commit comments

Comments
 (0)