summaryrefslogtreecommitdiffstats
path: root/src/gui.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2006-04-21 22:12:41 +0000
committerBram Moolenaar <Bram@vim.org>2006-04-21 22:12:41 +0000
commit57657d85c6c3d812e99b5e5d5161c07c66ac7dc7 (patch)
tree35b6845dc38717148718ac5cf70553b8c2cb96d8 /src/gui.c
parentfc1421eb53b17aa58b01a9c07ba2007eb4a1aa4f (diff)
updated for version 7.0e05v7.0e05
Diffstat (limited to 'src/gui.c')
-rw-r--r--src/gui.c22
1 files changed, 14 insertions, 8 deletions
diff --git a/src/gui.c b/src/gui.c
index 755c20c1f4..0fdcabe5a4 100644
--- a/src/gui.c
+++ b/src/gui.c
@@ -3407,31 +3407,36 @@ gui_update_tabline()
}
/*
- * Get the label for tab page "tp" into NameBuff[].
+ * Get the label or tooltip for tab page "tp" into NameBuff[].
*/
void
-get_tabline_label(tp)
+get_tabline_label(tp, tooltip)
tabpage_T *tp;
+ int tooltip; /* TRUE: get tooltip */
{
int modified = FALSE;
char_u buf[40];
int wincount;
win_T *wp;
+ char_u *opt;
- /* Use 'guitablabel' if it's set. */
- if (*p_gtl != NUL)
+ /* Use 'guitablabel' or 'guitabtooltip' if it's set. */
+ opt = (tooltip ? p_gtt : p_gtl);
+ if (*opt != NUL)
{
int use_sandbox = FALSE;
int save_called_emsg = called_emsg;
char_u res[MAXPATHL];
tabpage_T *save_curtab;
+ char_u *opt_name = (char_u *)(tooltip ? "guitabtooltip"
+ : "guitablabel");
called_emsg = FALSE;
printer_page_num = tabpage_index(tp);
# ifdef FEAT_EVAL
set_vim_var_nr(VV_LNUM, printer_page_num);
- use_sandbox = was_set_insecurely((char_u *)"guitablabel", 0);
+ use_sandbox = was_set_insecurely(opt_name, 0);
# endif
/* It's almost as going to the tabpage, but without autocommands. */
curtab->tp_firstwin = firstwin;
@@ -3446,7 +3451,7 @@ get_tabline_label(tp)
curbuf = curwin->w_buffer;
/* Can't use NameBuff directly, build_stl_str_hl() uses it. */
- build_stl_str_hl(curwin, res, MAXPATHL, p_gtl, use_sandbox,
+ build_stl_str_hl(curwin, res, MAXPATHL, opt, use_sandbox,
0, (int)Columns, NULL, NULL);
STRCPY(NameBuff, res);
@@ -3459,7 +3464,7 @@ get_tabline_label(tp)
curbuf = curwin->w_buffer;
if (called_emsg)
- set_string_option_direct((char_u *)"guitablabel", -1,
+ set_string_option_direct(opt_name, -1,
(char_u *)"", OPT_FREE, SID_ERROR);
called_emsg |= save_called_emsg;
}
@@ -3467,7 +3472,8 @@ get_tabline_label(tp)
{
/* Get the buffer name into NameBuff[] and shorten it. */
get_trans_bufname(tp == curtab ? curbuf : tp->tp_curwin->w_buffer);
- shorten_dir(NameBuff);
+ if (!tooltip)
+ shorten_dir(NameBuff);
wp = (tp == curtab) ? firstwin : tp->tp_firstwin;
for (wincount = 0; wp != NULL; wp = wp->w_next, ++wincount)