]> git.ipfire.org Git - thirdparty/vim.git/commitdiff
updated for version 7.0203
authorBram Moolenaar <Bram@vim.org>
Tue, 21 Feb 2006 22:02:53 +0000 (22:02 +0000)
committerBram Moolenaar <Bram@vim.org>
Tue, 21 Feb 2006 22:02:53 +0000 (22:02 +0000)
runtime/doc/gui.txt
runtime/doc/tabpage.txt
src/buffer.c
src/ex_docmd.c
src/message.c
src/netbeans.c

index 066cfd496c4f55e36d236fde9ef61105b83776ef..de4b317c6a2884ff226251daa05306a8c5532b46 100644 (file)
@@ -1,4 +1,4 @@
-*gui.txt*       For Vim version 7.0aa.  Last change: 2006 Feb 14
+*gui.txt*       For Vim version 7.0aa.  Last change: 2006 Feb 21
 
 
                  VIM REFERENCE MANUAL    by Bram Moolenaar
@@ -955,6 +955,9 @@ This section describes other features which are related to the GUI.
            endif
        endif
 
+A recommended Japanese font is MS Mincho.  You can find info here:
+http://www.lexikan.com/mincho.htm
+
 ==============================================================================
 7. Shell Commands                                      *gui-shell*
 
index b7cd51bd8617468632657127d5283f1c6e5eb146..e0e8b17ede2bbf11d95a8982bd0cec61515051ed 100644 (file)
@@ -1,4 +1,4 @@
-*tabpage.txt*   For Vim version 7.0aa.  Last change: 2006 Feb 20
+*tabpage.txt*   For Vim version 7.0aa.  Last change: 2006 Feb 21
 
 
                  VIM REFERENCE MANUAL    by Bram Moolenaar
@@ -10,9 +10,10 @@ The commands which have been added to use multiple tab pages are explained
 here.  Additionally, there are explanations for commands that work differently
 when used in combination with more than one tab page.
 
-1.  Introduction                       |tab-page-intro|
-2.  Commands                           |tab-page-commands|
-3.  Other items                                |tab-page-other|
+1. Introduction                        |tab-page-intro|
+2. Commands                    |tab-page-commands|
+3. Other items                 |tab-page-other|
+4. Setting 'tabline'           |setting-tabline|
 
 {Vi does not have any of these commands}
 {not able to use multiple tab pages when the |+windows| feature was disabled
@@ -111,12 +112,6 @@ Other commands:
 ==============================================================================
 3. Other items                                         *tab-page-other*
 
-You can use the 'tabline' option to specify when you want the line with tab
-page labels to appear: never, when there is more than one tab page or always.
-
-The highlighting of the tab pages line is set with the groups TabLine
-TabLineSel and TabLineFill.  |hl-TabLine| |hl-TabLineSel| |hl-TabLineFill|
-
 Diff mode works per tab page.  You can see the diffs between several files
 within one tab page.  Other tab pages can show differences between other
 files.
@@ -133,7 +128,7 @@ triggers:
        BufLeave                leave current buffer
        BufEnter                enter new empty buffer
 
-For switching to another tab page the order is:
+When switching to another tab page the order is:
        BufLeave
        WinLeave
        TabLeave
@@ -141,5 +136,58 @@ For switching to another tab page the order is:
        WinEnter
        BufEnter
 
+==============================================================================
+4. Setting 'tabline'                                   *setting-tabline*
+
+You can use the 'showtabline' option to specify when you want the line with
+tab page labels to appear: never, when there is more than one tab page or
+always.
+
+The highlighting of the tab pages line is set with the groups TabLine
+TabLineSel and TabLineFill.  |hl-TabLine| |hl-TabLineSel| |hl-TabLineFill|
+
+The 'tabline' option allows you to define your preferred way to tab pages
+labels.  This isn't easy, thus an example will be given here.
+
+For basics see the 'statusline' option.  The same items can be used in the
+'tabline' option.  Additionally, the |tabpagebuflist()|, |tabpagenr()| and
+|tabpagewinnr()| functions are useful.
+
+Since the number of tab labels will vary, you need to use an expresion for the
+whole option.  Something like: >
+       :set tabline=%!MyTabLine()
+
+Then define the MyTabLine() function to list all the tab pages labels.  A
+convenient method is to split it in two parts:  First go over all the tab
+pages and define labels for them.  Then get the label for each tab page. >
+
+       function MyTabLine()
+         let s = ''
+         for i in range(tabpagenr('$'))
+           if i + 1 == tabpagenr()
+             let s .= '%#TabLineSel#'
+           else
+             let s .= '%#TabLine#'
+           endif
+           let s .= ' %{MyTabLabel(' . (i + 1) . ')} '
+         endfor
+         let s .= '%#TabLineFill#'
+         return s
+       endfunction
+
+Now the MyTabLabel() function is called for each tab page to get its label. >
+
+       function MyTabLabel(n)
+         let buflist = tabpagebuflist(a:n)
+         let winnr = tabpagewinnr(a:n)
+         return bufname(buflist[winnr - 1])
+       endfunction
+
+This is just a simplistic example that results in a tab pages line that
+resembles the default, but without adding a + for a modified buffer or
+trunctating the names.  You will want to reduce the width of labels in a
+clever way when there is not enough room.  Check the 'columns' option for the
+space available, keeping in mind that the "X" at the right will take one more
+position.
 
  vim:tw=78:ts=8:ft=help:norl:
index 9af8d507d2688047c1a03a94f222bf3f44ff797f..12ee1b3b53665c276975765f3cd7f03bbf85569e 100644 (file)
@@ -2947,15 +2947,12 @@ fileinfo(fullname, shorthelp, dont_truncate)
     {
        p = msg_trunc_attr(buffer, FALSE, 0);
        if (restart_edit != 0 || (msg_scrolled && !need_wait_return))
-       {
            /* Need to repeat the message after redrawing when:
             * - When restart_edit is set (otherwise there will be a delay
             *   before redrawing).
             * - When the screen was scrolled but there is no wait-return
             *   prompt. */
-           set_keep_msg(p);
-           keep_msg_attr = 0;
-       }
+           set_keep_msg(p, 0);
     }
 
     vim_free(buffer);
@@ -3271,6 +3268,20 @@ build_stl_str_hl(wp, out, outlen, fmt, use_sandbox, fillchar, maxwidth, hl)
     char_u     opt;
 #define TMPLEN 70
     char_u     tmp[TMPLEN];
+    char_u     *usefmt = fmt;
+
+#ifdef FEAT_EVAL
+    /*
+     * When the format starts with "%!" then evaluate it as an expression and
+     * use the result as the actual format string.
+     */
+    if (fmt[0] == '%' && fmt[1] == '!')
+    {
+       usefmt = eval_to_string_safe(fmt + 2, NULL, use_sandbox);
+       if (usefmt == NULL)
+           usefmt = (char_u *)"";
+    }
+#endif
 
     if (fillchar == 0)
        fillchar = ' ';
@@ -3286,7 +3297,7 @@ build_stl_str_hl(wp, out, outlen, fmt, use_sandbox, fillchar, maxwidth, hl)
     curitem = 0;
     prevchar_isflag = TRUE;
     prevchar_isitem = FALSE;
-    for (s = fmt; *s;)
+    for (s = usefmt; *s; )
     {
        if (*s != NUL && *s != '%')
            prevchar_isflag = prevchar_isitem = FALSE;
@@ -3432,7 +3443,7 @@ build_stl_str_hl(wp, out, outlen, fmt, use_sandbox, fillchar, maxwidth, hl)
            if (minwid < 0)     /* overflow */
                minwid = 0;
        }
-       if (*s == STL_HIGHLIGHT)
+       if (*s == STL_USER_HL)
        {
            item[curitem].type = Highlight;
            item[curitem].start = p;
@@ -3698,6 +3709,20 @@ build_stl_str_hl(wp, out, outlen, fmt, use_sandbox, fillchar, maxwidth, hl)
                case 7: str = (char_u *)",+-"; break;
            }
            break;
+
+       case STL_HIGHLIGHT:
+           t = s;
+           while (*s != '#' && *s != NUL)
+               ++s;
+           if (*s == '#')
+           {
+               item[curitem].type = Highlight;
+               item[curitem].start = p;
+               item[curitem].minwid = -syn_namen2id(t, s - t);
+               curitem++;
+           }
+           ++s;
+           continue;
        }
 
        item[curitem].start = p;
@@ -3814,6 +3839,11 @@ build_stl_str_hl(wp, out, outlen, fmt, use_sandbox, fillchar, maxwidth, hl)
     *p = NUL;
     itemcnt = curitem;
 
+#ifdef FEAT_EVAL
+    if (usefmt != fmt)
+       vim_free(usefmt);
+#endif
+
     width = vim_strsize(out);
     if (maxwidth > 0 && width > maxwidth)
     {
index 1eefcd892eb955bcb26ffbc0d19d8355be3901b7..5798250d722884384fd63aa0df58a3b30ce8d0c4 100644 (file)
@@ -7029,7 +7029,7 @@ ex_tabs(eap)
        out_flush();        /* output one line at a time */
        ui_breakcheck();
 
-       if (tp->tp_topframe == topframe)
+       if (tp  == curtab)
            wp = firstwin;
        else
            wp = tp->tp_firstwin;
index 1cea013d0a0288a3e718e35de214f5457a8f727e..5521a15b51e4ecf37b3162667fc9293a650b9b8a 100644 (file)
@@ -180,10 +180,7 @@ msg_attr_keep(s, attr, keep)
 
     if (keep && retval && vim_strsize(s) < (int)(Rows - cmdline_row - 1)
                                                           * Columns + sc_col)
-    {
-       set_keep_msg(s);
-       keep_msg_attr = 0;
-    }
+       set_keep_msg(s, 0);
 
     vim_free(buf);
     --entered;
@@ -1077,8 +1074,9 @@ hit_return_msg()
  * Set "keep_msg" to "s".  Free the old value and check for NULL pointer.
  */
     void
-set_keep_msg(s)
+set_keep_msg(s, attr)
     char_u     *s;
+    int                attr;
 {
     vim_free(keep_msg);
     if (s != NULL && msg_silent == 0)
@@ -1086,8 +1084,23 @@ set_keep_msg(s)
     else
        keep_msg = NULL;
     keep_msg_more = FALSE;
+    keep_msg_attr = attr;
 }
 
+#if defined(FEAT_TERMRESPONSE) || defined(PROTO)
+/*
+ * If there currently is a message being displayed, set "keep_msg" to it, so
+ * that it will be displayed again after redraw.
+ */
+    void
+set_keep_msg_from_hist()
+{
+    if (keep_msg == NULL && last_msg_hist != NULL && msg_scrolled == 0
+                                                         && (State & NORMAL))
+       set_keep_msg(last_msg_hist->msg, last_msg_hist->attr);
+}
+#endif
+
 /*
  * Prepare for outputting characters in the command line.
  */
@@ -3161,7 +3174,7 @@ give_warning(message, hl)
     else
        keep_msg_attr = 0;
     if (msg_attr(message, keep_msg_attr) && msg_scrolled == 0)
-       set_keep_msg(message);
+       set_keep_msg(message, keep_msg_attr);
     msg_didout = FALSE;            /* overwrite this message */
     msg_nowait = TRUE;     /* don't wait for this message */
     msg_col = 0;
index d183e498eca97bd3d51e8cecaa66cda13d71fdc9..eb9146bba82bb23e219ff4a8eca34aa7ea50e95e 100644 (file)
@@ -3442,8 +3442,7 @@ print_save_msg(buf, nchars)
             *   before redrawing).
             * - When the screen was scrolled but there is no wait-return
             *   prompt. */
-           set_keep_msg(p);
-           keep_msg_attr = 0;
+           set_keep_msg(p, 0);
        }
        msg_scrolled_ign = FALSE;
        /* add_to_input_buf((char_u *)"\f", 1); */