forked from aniani/vim
patch 8.1.1789: cannot see file name of preview popup window
Problem: Cannot see file name of preview popup window. Solution: Add the file name as the title.
This commit is contained in:
@@ -3171,6 +3171,10 @@ do_ecmd(
|
||||
|
||||
#ifdef FEAT_TITLE
|
||||
maketitle();
|
||||
#endif
|
||||
#ifdef FEAT_TEXT_PROP
|
||||
if (popup_is_popup(curwin) && curwin->w_p_pvw)
|
||||
popup_set_title(curwin);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
@@ -6101,6 +6101,9 @@ shorten_fnames(int force)
|
||||
}
|
||||
status_redraw_all();
|
||||
redraw_tabline = TRUE;
|
||||
#ifdef FEAT_TEXT_PROP
|
||||
popup_update_preview_title();
|
||||
#endif
|
||||
}
|
||||
|
||||
#if (defined(FEAT_DND) && defined(FEAT_GUI_GTK)) \
|
||||
|
@@ -3198,4 +3198,41 @@ popup_close_preview()
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Set the title of the popup window to the file name.
|
||||
*/
|
||||
void
|
||||
popup_set_title(win_T *wp)
|
||||
{
|
||||
if (wp->w_buffer->b_fname != NULL)
|
||||
{
|
||||
char_u dirname[MAXPATHL];
|
||||
size_t len;
|
||||
|
||||
mch_dirname(dirname, MAXPATHL);
|
||||
shorten_buf_fname(wp->w_buffer, dirname, FALSE);
|
||||
|
||||
vim_free(wp->w_popup_title);
|
||||
len = STRLEN(wp->w_buffer->b_fname) + 3;
|
||||
wp->w_popup_title = alloc((int)len);
|
||||
if (wp->w_popup_title != NULL)
|
||||
vim_snprintf((char *)wp->w_popup_title, len, " %s ",
|
||||
wp->w_buffer->b_fname);
|
||||
redraw_win_later(wp, VALID);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* If there is a preview window, update the title.
|
||||
* Used after changing directory.
|
||||
*/
|
||||
void
|
||||
popup_update_preview_title(void)
|
||||
{
|
||||
win_T *wp = popup_find_preview_window();
|
||||
|
||||
if (wp != NULL)
|
||||
popup_set_title(wp);
|
||||
}
|
||||
|
||||
#endif // FEAT_TEXT_PROP
|
||||
|
@@ -47,4 +47,6 @@ void f_popup_getpreview(typval_T *argvars, typval_T *rettv);
|
||||
int popup_is_popup(win_T *wp);
|
||||
int popup_create_preview_window(void);
|
||||
void popup_close_preview(void);
|
||||
void popup_set_title(win_T *wp);
|
||||
void popup_update_preview_title(void);
|
||||
/* vim: set ft=c : */
|
||||
|
@@ -1,5 +1,5 @@
|
||||
|o+0&#ffffff0|n|e| @71
|
||||
|t|w|o| @1|╔+0#0000001#ffd7ff255|═@40|X| +0#0000000#ffffff0@26
|
||||
|t|w|o| @1|╔+0#0000001#ffd7ff255| |X|t|a|g|f|i|l|e| |═@30|X| +0#0000000#ffffff0@26
|
||||
|t|h|r|e@1|║+0#0000001#ffd7ff255|2|0| @37| +0#0000000#a8a8a8255|║+0#0000001#ffd7ff255| +0#0000000#ffffff0@26
|
||||
|f|o|u|r| |║+0#0000001#ffd7ff255|t|h|e|w|o|r|d| |i|s| |h|e|r|e| @24| +0#0000000#a8a8a8255|║+0#0000001#ffd7ff255| +0#0000000#ffffff0@26
|
||||
|f|i|v|e| |║+0#0000001#ffd7ff255|2@1| @37| +0#0000000#0000001|║+0#0000001#ffd7ff255| +0#0000000#ffffff0@26
|
||||
|
@@ -1,7 +1,7 @@
|
||||
|o+0&#ffffff0|n|e| @71
|
||||
|t|w|o| @71
|
||||
|t|h|r|e@1| @69
|
||||
|f|o|u|r| @3|╔+0#0000001#ffd7ff255|═@40|X| +0#0000000#ffffff0@23
|
||||
|f|o|u|r| @3|╔+0#0000001#ffd7ff255| |X|t|a|g|f|i|l|e| |═@30|X| +0#0000000#ffffff0@23
|
||||
|f|i|v|e| @3|║+0#0000001#ffd7ff255|2|7| @37| +0#0000000#a8a8a8255|║+0#0000001#ffd7ff255| +0#0000000#ffffff0@23
|
||||
|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
|
||||
|s|e|v|e|n| @2|║+0#0000001#ffd7ff255|2|9| @37| +0#0000000#0000001|║+0#0000001#ffd7ff255| +0#0000000#ffffff0@23
|
||||
|
@@ -1,7 +1,7 @@
|
||||
|o+0&#ffffff0|n|e| @71
|
||||
|t|w|o| @71
|
||||
|t|h|r|e@1| @69
|
||||
|f|o|u|r| @9|╔+0#0000001#ffd7ff255|═@40|X| +0#0000000#ffffff0@17
|
||||
|f|o|u|r| @9|╔+0#0000001#ffd7ff255| |X|t|a|g|f|i|l|e| |═@30|X| +0#0000000#ffffff0@17
|
||||
|f|i|v|e| @9|║+0#0000001#ffd7ff255|2|7| @37| +0#0000000#a8a8a8255|║+0#0000001#ffd7ff255| +0#0000000#ffffff0@17
|
||||
|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
|
||||
|s|e|v|e|n| @8|║+0#0000001#ffd7ff255|2|9| @37| +0#0000000#0000001|║+0#0000001#ffd7ff255| +0#0000000#ffffff0@17
|
||||
|
@@ -2,7 +2,7 @@
|
||||
|t|w|o| @71
|
||||
|t|h|r|e@1| @69
|
||||
|f|o|u|r| @70
|
||||
|f|i|v|e| @27|╔+0#0000001#ffd7ff255|═@40|X
|
||||
|f|i|v|e| @27|╔+0#0000001#ffd7ff255| |X|t|a|g|f|i|l|e| |═@30|X
|
||||
|s+0#0000000#ffffff0|i|x| @28|║+0#0000001#ffd7ff255|2|7| @37| +0#0000000#a8a8a8255|║+0#0000001#ffd7ff255
|
||||
|s+0#0000000#ffffff0|e|v|e|n| @26|║+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
|
||||
|f+0#0000000#ffffff0|i|n|d| |t|h|e|w|o|r|d| |s|o|m|e|w|h|e|r|e| @9|║+0#0000001#ffd7ff255|2|9| @37| +0#0000000#0000001|║+0#0000001#ffd7ff255
|
||||
|
14
src/testdir/dumps/Test_popupwin_previewpopup_5.dump
Normal file
14
src/testdir/dumps/Test_popupwin_previewpopup_5.dump
Normal file
@@ -0,0 +1,14 @@
|
||||
|o+0&#ffffff0|n|e| @71
|
||||
|t|w|o| @71
|
||||
|t|h|r|e@1| @69
|
||||
|f|o|u|r| @70
|
||||
|f|i|v|e| @27|╔+0#0000001#ffd7ff255| |t|e|s|t|d|i|r|/|X|t|a|g|f|i|l|e| |═@22|X
|
||||
|s+0#0000000#ffffff0|i|x| @28|║+0#0000001#ffd7ff255|2|7| @37| +0#0000000#a8a8a8255|║+0#0000001#ffd7ff255
|
||||
|s+0#0000000#ffffff0|e|v|e|n| @26|║+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
|
||||
|f+0#0000000#ffffff0|i|n|d| |t|h|e|w|o|r|d| |s|o|m|e|w|h|e|r|e| @9|║+0#0000001#ffd7ff255|2|9| @37| +0#0000000#0000001|║+0#0000001#ffd7ff255
|
||||
|n+0#0000000#ffffff0|i|n|e| @27|║+0#0000001#ffd7ff255|3|0| @37| +0#0000000#a8a8a8255|║+0#0000001#ffd7ff255
|
||||
|t+0#0000000#ffffff0|h|i|s| |i|s| |a|n|o|t|h|e|r| |w|o|r|d| @11|╚+0#0000001#ffd7ff255|═@40|⇲
|
||||
|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
|
||||
|~+0#4040ff13&| @73
|
||||
|~| @73
|
||||
|:+0#0000000&| @55|1@1|,|3|9| @8|A|l@1|
|
@@ -773,6 +773,8 @@ static char *(features[]) =
|
||||
|
||||
static int included_patches[] =
|
||||
{ /* Add new patch number below this line */
|
||||
/**/
|
||||
1789,
|
||||
/**/
|
||||
1788,
|
||||
/**/
|
||||
|
Reference in New Issue
Block a user