]> git.ipfire.org Git - thirdparty/vim.git/commitdiff
updated for version 7.0g04
authorBram Moolenaar <Bram@vim.org>
Fri, 5 May 2006 21:15:17 +0000 (21:15 +0000)
committerBram Moolenaar <Bram@vim.org>
Fri, 5 May 2006 21:15:17 +0000 (21:15 +0000)
12 files changed:
runtime/doc/change.txt
runtime/doc/eval.txt
runtime/doc/help.txt
runtime/doc/insert.txt
runtime/ftplugin/ruby.vim
runtime/indent/html.vim
src/edit.c
src/gui_gtk.c
src/screen.c
src/search.c
src/testdir/test60.in
src/version.h

index 4cc671116e3543ffa48c3c63367e4706db576fdf..9c67953bd97265f4155443734add4c111cecd9ed 100644 (file)
@@ -1,4 +1,4 @@
-*change.txt*    For Vim version 7.0g.  Last change: 2006 Apr 30
+*change.txt*    For Vim version 7.0g.  Last change: 2006 May 05
 
 
                  VIM REFERENCE MANUAL    by Bram Moolenaar
@@ -1429,8 +1429,9 @@ value     action  ~
 "c"    automatic formatting for comments, but not text (good for C code)
 "tc"   automatic formatting for text and comments
 
-Note that when 'textwidth' is 0, Vim does no formatting anyway (but does
-insert comment leaders according to the 'comments' option).
+Note that when 'textwidth' is 0, Vim does no automatic formatting anyway (but
+does insert comment leaders according to the 'comments' option).  An exception
+is when the 'a' flag is present. |auto-format|
 
 Note that when 'paste' is on, Vim does no formatting at all.
 
@@ -1485,6 +1486,9 @@ editing text paragraphs.  A few hints on how to use this:
 
 - Add the 'c' flag to only auto-format comments.  Useful in source code.
 
+- Set 'textwidth' to the desired width.  If it is zero then 79 is used, or the
+  width of the screen if this is smaller.
+
 And a few warnings:
 
 - When part of the text is not properly separated in paragraphs, making
index 3696c8aa815fa996b3c6494aeb92dc19b5fa247b..97940895b8d2df4ff0af8772964b901f52399294 100644 (file)
@@ -1,4 +1,4 @@
-*eval.txt*      For Vim version 7.0g.  Last change: 2006 May 04
+*eval.txt*      For Vim version 7.0g.  Last change: 2006 May 05
 
 
                  VIM REFERENCE MANUAL    by Bram Moolenaar
@@ -2346,12 +2346,13 @@ exists({expr})  The result is a Number, which is non-zero if {expr} is
                        exists("##ColorScheme")
 <              There must be no space between the symbol (&/$/*/#) and the
                name.
-               Trailing characters that can't be part of the name are often
-               ignored, but don't depend on it, it may change in the future!
-               Example: >
-                       exists("*strftime()")
-<              This currently works, but it should really be: >
-                       exists("*strftime")
+               There must be no extra characters after the name, although in
+               a few cases this is ignored.  That may become more strict in
+               the future, thus don't count on it!
+               Working example: >
+                       exists(":make")
+<              NOT working example: >
+                       exists(":make install")
 
 <              Note that the argument must be a string, not the name of the
                variable itself.  For example: >
@@ -2678,21 +2679,25 @@ getbufvar({expr}, {varname})                            *getbufvar()*
                        :echo "todo myvar = " . getbufvar("todo", "myvar")
 <
 getchar([expr])                                                *getchar()*
-               Get a single character from the user.  If it is an 8-bit
-               character, the result is a number.  Otherwise a String is
-               returned with the encoded character.  For a special key it's a
-               sequence of bytes starting with 0x80 (decimal: 128).
+               Get a single character from the user or input stream.
                If [expr] is omitted, wait until a character is available.
                If [expr] is 0, only get a character when one is available.
+                       Return zero otherwise.
                If [expr] is 1, only check if a character is available, it is
-                               not consumed.  If one is available a non-zero
-                               number is returned.  For a one-byte character
-                               it is the character itself.
-               If a normal character available, it is returned as a Number.
-               Use nr2char() to convert it to a String.
-               The returned value is zero if no character is available.
-               The returned value is a string of characters for special keys
-               and when a modifier (shift, control, alt) was used.
+                       not consumed.  Return zero if no character available.
+
+               Without {expr} and when {expr} is 0 a whole character or
+               special key is returned.  If it is an 8-bit character, the
+               result is a number.  Use nr2char() to convert it to a String.
+               Otherwise a String is returned with the encoded character.
+               For a special key it's a sequence of bytes starting with 0x80
+               (decimal: 128).  The returned value is also a String when a
+               modifier (shift, control, alt) was used that is not included
+               in the character.
+
+               When {expr} is 1 only the first byte is returned.  For a
+               one-byte character it is the character itself.
+
                There is no prompt, you will somehow have to make clear to the
                user that a character has to be typed.
                There is no mapping for the character.
index 788143af7b7c4685a21d88709067ba27d6ee6abc..79ae5b9dba2ddf19831c405c3a52a11c39abf158 100644 (file)
@@ -1,4 +1,4 @@
-*help.txt*     For Vim version 7.0g.  Last change: 2006 May 04
+*help.txt*     For Vim version 7.0g.  Last change: 2006 May 05
 
                        VIM - main help file
                                                                         k
@@ -202,6 +202,12 @@ LOCAL ADDITIONS:                           *local-additions*
 |test.txt|     Testing the hélp cömmånd nôw
 |typecorr.txt| Plugin for correcting typing mistakes
 |helpp.txt|    Dummy line to avoid an error message
+|cecutil.txt|  DrChip's Utilities                              Jun 11, 2004
+|example.txt|  Example for a locally added help file
+|matchit.txt|   Extended "%" matching
+|test.txt|     Testing the hélp cömmånd nôw
+|typecorr.txt| Plugin for correcting typing mistakes
+|helpp.txt|    Dummy line to avoid an error message
 
 ------------------------------------------------------------------------------
 *bars*         Bars example
@@ -210,7 +216,7 @@ Now that you've jumped here with CTRL-] or a double mouse click, you can use
 CTRL-T, CTRL-O, g<RightMouse>, or <C-RightMouse> to go back to where you were.
 
 Note that tags are within | characters, but when highlighting is enabled these
-are hidden.  That makes it easier to read the command.
+are hidden.  That makes it easier to read a command.
 
 Anyway, you can use CTRL-] on any word, also when it is not within |, and Vim
 will try to find help for it.
index 48d45502369cd8dfe7a15f6bb65660439e5de3cf..97e964e73613372d8be1df4d54553291ababbb88 100644 (file)
@@ -1,4 +1,4 @@
-*insert.txt*    For Vim version 7.0g.  Last change: 2006 May 03
+*insert.txt*    For Vim version 7.0g.  Last change: 2006 May 05
 
 
                  VIM REFERENCE MANUAL    by Bram Moolenaar
@@ -1020,8 +1020,9 @@ items:
        info            more information about the item, can be displayed in a
                        preview window
        kind            single letter indicating the type of completion
-       icase           when non-zero case is to be ignored; when omitted
-                       the 'ignorecase' option is used
+       icase           when non-zero case is to be ignored when comparing
+                       items to be equal; when omitted zero is used, thus
+                       items that only differ in case are added
        dup             when non-zero this match will be added even when an
                        item with the same word is already present.
 
index 40d1c5540beefaf9709690253139a61f7473cb53..66cfcc787696d554e2f0ce888f6c02620e5615bc 100644 (file)
@@ -1,6 +1,6 @@
 " Vim filetype plugin
 " Language:            Ruby
-" Maintainer:          Gavin Sinclair <gsinclair at soyabean.com.au>
+" Maintainer:          Gavin Sinclair <gsinclair at gmail.com>
 " Info:                        $Id$
 " URL:                 http://vim-ruby.rubyforge.org
 " Anon CVS:            See above site
@@ -38,7 +38,8 @@ if exists("loaded_matchit") && !exists("b:match_words")
     \    '\%(\%(^\|;\)\s*\)\@<=\<rescue\>' .
     \ '\)' .
     \ ':' .
-    \ '\%(\%(\.\|\:\:\)\s*\|\:\)\@<!\<end\>'
+    \ '\%(\%(\.\|\:\:\)\s*\|\:\)\@<!\<end\>' .
+    \ ',{:},\[:\],(:)'
 
   let b:match_skip =
      \ "synIDattr(synID(line('.'),col('.'),0),'name') =~ '" .
index cfea7d85e6e9fddc57b235b30d4a859b1b74702a..be34409552121283dbc00e4f03abb9d2e266f581 100644 (file)
@@ -1,6 +1,7 @@
 " Description: html indenter
 " Author:      Johannes Zellner <johannes@zellner.org>
 " Last Change: Tue, 27 Apr 2004 10:28:39 CEST
+"              Restoring 'cpo' and 'ic' added by Bram 2006 May 5
 " Globals:     g:html_indent_tags         -- indenting tags
 "              g:html_indent_strict       -- inhibit 'O O' elements
 "              g:html_indent_strict_table -- inhibit 'O -' elements
@@ -116,6 +117,7 @@ endif
 
 delfun <SID>HtmlIndentPush
 
+let s:cpo_save = &cpo
 set cpo-=C
 
 " [-- count indent-increasing tags of line a:lnum --]
@@ -183,6 +185,9 @@ fun! HtmlIndentGet(lnum)
                \ || 0 < searchpair('\c<pre>', '', '\c</pre>', 'nWb')
                \ || 0 < searchpair('\c<pre>', '', '\c</pre>', 'nW')
        " we're in a line with </pre> or inside <pre> ... </pre>
+       if restore_ic == 0
+         setlocal noic
+       endif
        return -1
     endif
 
@@ -192,6 +197,9 @@ fun! HtmlIndentGet(lnum)
     \ || 0 < searchpair(js, '', '</script>', 'nW')
        " we're inside javascript
        if getline(lnum) !~ js && getline(a:lnum) != '</script>'
+           if restore_ic == 0
+             setlocal noic
+           endif
            return cindent(a:lnum)
        endif
     endif
@@ -202,6 +210,9 @@ fun! HtmlIndentGet(lnum)
        " starting <pre> to restore the indent.
        let preline = prevnonblank(search('\c<pre>', 'bW') - 1)
        if preline > 0
+           if restore_ic == 0
+             setlocal noic
+           endif
            return indent(preline)
        endif
     endif
@@ -216,4 +227,7 @@ fun! HtmlIndentGet(lnum)
     return indent(lnum) + (&sw * ind)
 endfun
 
+let &cpo = s:cpo_save
+unlet s:cpo_save
+
 " [-- EOF <runtime>/indent/html.vim --]
index 2ff17227390562a153658348d689c186aaebcd40..e298a8c389f3e223fa00bd52e537eb5ab1a9e78f 100644 (file)
@@ -2806,7 +2806,7 @@ ins_compl_files(count, files, thesaurus, flags, regmatch, buf, dir)
                        ptr = find_word_end(ptr);
                    add_r = ins_compl_add_infercase(regmatch->startp[0],
                                          (int)(ptr - regmatch->startp[0]),
-                                                    p_ic, files[i], *dir, 0);
+                                                    FALSE, files[i], *dir, 0);
                    if (thesaurus)
                    {
                        char_u *wstart;
@@ -2842,7 +2842,7 @@ ins_compl_files(count, files, thesaurus, flags, regmatch, buf, dir)
                                ptr = find_word_end(ptr);
                            add_r = ins_compl_add_infercase(wstart,
                                    (int)(ptr - wstart),
-                                   p_ic, files[i], *dir, 0);
+                                   FALSE, files[i], *dir, 0);
                        }
                    }
                    if (add_r == OK)
@@ -3534,7 +3534,7 @@ ins_compl_add_tv(tv, dir)
     int                dir;
 {
     char_u     *word;
-    int                icase = p_ic;
+    int                icase = FALSE;
     int                dup = FALSE;
     char_u     *(cptext[CPT_COUNT]);
 
@@ -3753,7 +3753,7 @@ ins_compl_get_exp(ini)
                    TAG_INS_COMP | (ctrl_x_mode ? TAG_VERBOSE : 0),
                    TAG_MANY, curbuf->b_ffname) == OK && num_matches > 0)
            {
-               ins_compl_add_matches(num_matches, matches, p_ic);
+               ins_compl_add_matches(num_matches, matches, FALSE);
            }
            p_ic = save_p_ic;
            break;
@@ -3928,7 +3928,7 @@ ins_compl_get_exp(ini)
                            continue;
                    }
                }
-               if (ins_compl_add_infercase(ptr, len, p_ic,
+               if (ins_compl_add_infercase(ptr, len, FALSE,
                                 ins_buf == curbuf ? NULL : ins_buf->b_sfname,
                                           0, flags) != NOTDONE)
                {
@@ -5818,7 +5818,7 @@ check_auto_format(end_insert)
  */
     int
 comp_textwidth(ff)
-    int                ff;     /* force formatting (for "Q" command) */
+    int                ff;     /* force formatting (for "gq" command) */
 {
     int                textwidth;
 
index 0da144fc975e7872e9f906b17d0338058baff68e..397b45180d53c2b5ca19aa1250b8b7221a6e2818 100644 (file)
@@ -2221,16 +2221,6 @@ dialog_key_press_event_cb(GtkWidget *widget, GdkEventKey *event, gpointer data)
 {
     DialogInfo *di = (DialogInfo *)data;
 
-#ifndef HAVE_GTK2
-    /* Ignore hitting "Enter" if there is no default button. */
-    if (event->keyval == GDK_Return)
-    {
-       if (!di->ignore_enter)
-           gtk_dialog_response(di->dialog, GTK_RESPONSE_ACCEPT);
-       return TRUE;
-    }
-#endif
-
     /* Close the dialog when hitting "Esc". */
     if (event->keyval == GDK_Escape)
     {
index f57adc04db8ae740a5afeb27cab80d45028d032d..222cd32a0c3022c5c297f7339af4ddc196152d1a 100644 (file)
@@ -2626,6 +2626,9 @@ win_line(wp, lnum, startrow, endrow, nochange)
     int                prev_c = 0;             /* previous Arabic character */
     int                prev_c1 = 0;            /* first composing char for prev_c */
 #endif
+#if defined(FEAT_DIFF) || defined(LINE_ATTR)
+    int                did_line_attr = 0;
+#endif
 
     /* draw_state: items that are drawn in sequence: */
 #define WL_START       0               /* nothing done yet */
@@ -4133,6 +4136,13 @@ win_line(wp, lnum, startrow, endrow, nochange)
                    /* Highlight until the right side of the window */
                    c = ' ';
                    --ptr;          /* put it back at the NUL */
+
+                   /* Remember we do the char for line highlighting. */
+                   ++did_line_attr;
+
+                   /* don't do search HL for the rest of the line */
+                   if (line_attr != 0 && char_attr == search_attr && col > 0)
+                       char_attr = line_attr;
 # ifdef FEAT_DIFF
                    if (diff_hlf == HLF_TXD)
                    {
@@ -4224,22 +4234,34 @@ win_line(wp, lnum, startrow, endrow, nochange)
        }
 
        /*
-        * At end of the text line.
+        * At end of the text line or just after the last character.
         */
-       if (c == NUL)
+       if (c == NUL
+#if defined(FEAT_DIFF) || defined(LINE_ATTR)
+               || did_line_attr == 1
+#endif
+               )
        {
+#ifdef FEAT_SEARCH_EXTRA
+           long prevcol = (long)(ptr - line) - (c == NUL);
+#endif
+
            /* invert at least one char, used for Visual and empty line or
             * highlight match at end of line. If it's beyond the last
             * char on the screen, just overwrite that one (tricky!)  Not
             * needed when a '$' was displayed for 'list'. */
            if (lcs_eol == lcs_eol_one
-                   && ((area_attr != 0 && vcol == fromcol)
+                   && ((area_attr != 0 && vcol == fromcol && c == NUL)
 #ifdef FEAT_SEARCH_EXTRA
                        /* highlight 'hlsearch' match at end of line */
-                       || (ptr - line) - 1 == (long)search_hl.startcol
-                       || (ptr - line) - 1 == (long)match_hl[0].startcol
-                       || (ptr - line) - 1 == (long)match_hl[1].startcol
-                       || (ptr - line) - 1 == (long)match_hl[2].startcol
+                       || ((prevcol == (long)search_hl.startcol
+                               || prevcol == (long)match_hl[0].startcol
+                               || prevcol == (long)match_hl[1].startcol
+                               || prevcol == (long)match_hl[2].startcol)
+# if defined(FEAT_DIFF) || defined(LINE_ATTR)
+                           && did_line_attr <= 1
+# endif
+                          )
 #endif
                       ))
            {
@@ -4297,7 +4319,13 @@ win_line(wp, lnum, startrow, endrow, nochange)
                    ++col;
                ++vcol;
            }
+       }
 
+       /*
+        * At end of the text line.
+        */
+       if (c == NUL)
+       {
 #ifdef FEAT_SYN_HL
            /* Highlight 'cursorcolumn' past end of the line. */
            if (wp->w_p_wrap)
index 0e535ab228ca6b12771373b46ba4b3f60a0652cd..a8a390e1f7a3ce0f500841704921a38a11d69ebd 100644 (file)
@@ -4871,7 +4871,7 @@ search_line:
                        goto exit_matched;
                }
 
-               add_r = ins_compl_add_infercase(aux, i, p_ic,
+               add_r = ins_compl_add_infercase(aux, i, FALSE,
                        curr_fname == curbuf->b_fname ? NULL : curr_fname,
                        dir, reuse);
                if (add_r == OK)
@@ -5110,7 +5110,7 @@ show_pat_in_path(line, type, did_show, action, fp, lnum, count)
 
     if (did_show)
        msg_putchar('\n');      /* cursor below last one */
-    else
+    else if (!msg_silent)
        gotocmdline(TRUE);      /* cursor at status line */
     if (got_int)               /* 'q' typed at "--more--" message */
        return;
index 2c414b38ef6598dddc2d2f89caf4de8606d9ca90..d5a0d7c28ca7405a971e957eebfc99f4554743f7 100644 (file)
@@ -18,6 +18,8 @@ endfunction
 
     " valid autocmd group
     let test_cases += [['#myagroup', 1]]
+    " valid autocmd group with garbage
+    let test_cases += [['#myagroup+b', 0]]
     " Valid autocmd group and event
     let test_cases += [['#myagroup#BufEnter', 1]]
     " Valid autocmd group, event and pattern
@@ -51,6 +53,8 @@ endfunction
     let test_cases += [['&textwidth', 1]]
     " Existing and working option (short form)
     let test_cases += [['&tw', 1]]
+    " Existing and working option with garbage
+    let test_cases += [['&tw-', 0]]
     " Global option
     let test_cases += [['&g:errorformat', 1]]
     " Local option
@@ -64,6 +68,8 @@ endfunction
 
     " Existing and working option (long form)
     let test_cases += [['+incsearch', 1]]
+    " Existing and working option with garbage
+    let test_cases += [['+incsearch!1', 0]]
     " Existing and working option (short form)
     let test_cases += [['+is', 1]]
     " Existing option that is hidden.
@@ -77,8 +83,12 @@ endfunction
 
     " Valid internal function
     let test_cases += [['*bufnr', 1]]
+    " Valid internal function with ()
+    let test_cases += [['*bufnr()', 1]]
     " Non-existing internal function
     let test_cases += [['*myxyzfunc', 0]]
+    " Valid internal function with garbage
+    let test_cases += [['*bufnr&6', 0]]
 
     " Valid user defined function
     let test_cases += [['*TestExists', 1]]
@@ -100,6 +110,14 @@ endfunction
        echo "FAILED"
     endif
 
+    " Valid internal command (full match) with garbage
+    echo ':edit/a: 0'
+    if exists(':edit/a') == 0
+       echo "OK"
+    else
+       echo "FAILED"
+    endif
+
     " Valid internal command (partial match)
     echo ':q: 1'
     if exists(':q') == 1
@@ -171,6 +189,15 @@ endfunction
        echo "FAILED"
     endif
 
+    " Valid local variable with garbage
+    let local_var = 1
+    echo 'local_var%n: 0'
+    if !exists('local_var%n')
+       echo "OK"
+    else
+       echo "FAILED"
+    endif
+
     " Non-existing local variable
     unlet local_var
     echo 'local_var: 0'
@@ -189,6 +216,30 @@ endfunction
        echo "FAILED"
     endif
 
+    " Valid local list item
+    echo 'local_list[1]: 1'
+    if exists('local_list[1]')
+       echo "OK"
+    else
+       echo "FAILED"
+    endif
+
+    " Valid local list item with garbage
+    echo 'local_list[1]+5: 0'
+    if !exists('local_list[1]+5')
+       echo "OK"
+    else
+       echo "FAILED"
+    endif
+
+    " Invalid local list item
+    echo 'local_list[2]: 0'
+    if !exists('local_list[2]')
+       echo "OK"
+    else
+       echo "FAILED"
+    endif
+
     " Non-existing local list
     unlet local_list
     echo 'local_list: 0'
@@ -245,6 +296,14 @@ endfunction
        echo "FAILED"
     endif
 
+    " Existing global variable with garbage
+    echo 'g:global_var-n: 1'
+    if !exists('g:global_var-n')
+       echo "OK"
+    else
+       echo "FAILED"
+    endif
+
     " Non-existing global variable
     unlet g:global_var
     echo 'g:global_var: 0'
index 6323f460a8117d92e4902a2180f912de4b69f3ae..389219d49318e7cff42eb88c7cf5ab607c65756f 100644 (file)
@@ -35,6 +35,6 @@
  */
 #define VIM_VERSION_NODOT      "vim70g"
 #define VIM_VERSION_SHORT      "7.0g"
-#define VIM_VERSION_MEDIUM     "7.0g03 BETA"
-#define VIM_VERSION_LONG       "VIM - Vi IMproved 7.0g03 BETA (2006 May 4)"
-#define VIM_VERSION_LONG_DATE  "VIM - Vi IMproved 7.0g03 BETA (2006 May 4, compiled "
+#define VIM_VERSION_MEDIUM     "7.0g04 BETA"
+#define VIM_VERSION_LONG       "VIM - Vi IMproved 7.0g04 BETA (2006 May 5)"
+#define VIM_VERSION_LONG_DATE  "VIM - Vi IMproved 7.0g04 BETA (2006 May 5, compiled "