diff src/gui.c @ 839:1f3b1021f002 v7.0e05

updated for version 7.0e05
author vimboss
date Fri, 21 Apr 2006 22:12:41 +0000
parents 8e5830943bff
children 9f279ebda751
line wrap: on
line diff
--- 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;
-
-    /* Use 'guitablabel' if it's set. */
-    if (*p_gtl != NUL)
+    char_u	*opt;
+
+    /* 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)