]> granicus.if.org Git - vim/commitdiff
updated for version 7.0045
authorBram Moolenaar <Bram@vim.org>
Thu, 27 Jan 2005 14:41:15 +0000 (14:41 +0000)
committerBram Moolenaar <Bram@vim.org>
Thu, 27 Jan 2005 14:41:15 +0000 (14:41 +0000)
20 files changed:
Filelist
runtime/doc/autocmd.txt
runtime/doc/eval.txt
runtime/doc/insert.txt
runtime/doc/options.txt
runtime/doc/pattern.txt
runtime/doc/pi_netrw.txt
runtime/doc/syntax.txt
runtime/doc/tags
runtime/doc/various.txt
runtime/doc/version6.txt
runtime/doc/windows.txt
runtime/syntax/c.vim
src/edit.c
src/hashtable.c
src/mbyte.c
src/ops.c
src/search.c
src/structs.h
src/version.h

index ed315fc61dfd97df7e9615ebd7185336785967ba..bdd33c1624954f7ef67be991ae9cb9a752213d98 100644 (file)
--- a/Filelist
+++ b/Filelist
@@ -74,7 +74,7 @@ SRC_ALL2 =    \
                src/main.aap \
                src/testdir/main.aap \
                src/testdir/*.in \
-               src/testdir/*.ok \
+               src/testdir/test[0-9]*.ok \
                src/testdir/test49.vim \
                src/proto.h \
                src/proto/buffer.pro \
index 9c69d2cd3466bcfeafab759bcbd9ed3eae8b3fe9..2b7edf5ecade533315f19317b4645bf1b5ea3208 100644 (file)
@@ -1,4 +1,4 @@
-*autocmd.txt*   For Vim version 7.0aa.  Last change: 2004 Dec 24
+*autocmd.txt*   For Vim version 7.0aa.  Last change: 2005 Jan 26
 
 
                  VIM REFERENCE MANUAL    by Bram Moolenaar
@@ -495,7 +495,7 @@ InsertChange                        When typing <Insert> while in Insert or
                                anything else that the user does not expect.
                                                        *InsertLeave*
 InsertLeave                    When leaving Insert mode.  Also when using
-                               CTRL-O |i_CTRL-O|.
+                               CTRL-O |i_CTRL-O|.  But not for |i_CTRL-C|.
                                                        *FileEncoding*
 FileEncoding                   Obsolete.  It still works and is equivalent
                                to |EncodingChanged|.
index 5cb961132de1a2131add5c6e9e989e6caaa13a04..cbd233a3980132b478714f1b407550a0f041ec08 100644 (file)
@@ -1,4 +1,4 @@
-*eval.txt*      For Vim version 7.0aa.  Last change: 2005 Jan 25
+*eval.txt*      For Vim version 7.0aa.  Last change: 2005 Jan 27
 
 
                  VIM REFERENCE MANUAL    by Bram Moolenaar
@@ -1458,6 +1458,7 @@ inputsave()                       Number  save and clear typeahead
 inputsecret( {prompt} [, {text}]) String  like input() but hiding the text
 insert( {list}, {item} [, {idx}]) List insert {item} in {list} [before {idx}]
 isdirectory( {directory})      Number  TRUE if {directory} is a directory
+items( {dict})                 List    List of key-value pairs in {dict}
 join( {list} [, {sep}])                String  join {list} items into one String
 keys( {dict})                  List    List of keys in {dict}
 len( {expr})                   Number  the length of {expr}
@@ -1519,7 +1520,8 @@ string( {expr})                   String  String representation of {expr} value
 strlen( {expr})                        Number  length of the String {expr}
 strpart( {src}, {start}[, {len}])
                                String  {len} characters of {src} at {start}
-strridx( {haystack}, {needle}) Number  last index of {needle} in {haystack}
+strridx( {haystack}, {needle} [, {start}])
+                               Number  last index of {needle} in {haystack}
 strtrans( {expr})              String  translate string to make it printable
 submatch( {nr})                        String  specific match in ":substitute"
 substitute( {expr}, {pat}, {sub}, {flags})
@@ -1535,6 +1537,7 @@ toupper( {expr})          String  the String {expr} switched to uppercase
 tr( {src}, {fromstr}, {tostr}) String  translate chars of {src} in {fromstr}
                                        to chars in {tostr}
 type( {name})                  Number  type of variable {name}
+values( {dict})                        List    List of values in {dict}
 virtcol( {expr})               Number  screen column of cursor or mark
 visualmode( [expr])            String  last visual mode used
 winbufnr( {nr})                        Number  buffer number of window {nr}
@@ -2266,7 +2269,7 @@ function({name})                                  *function()* *E700*
                {name} can be a user defined function or an internal function.
 
 
-get({list}, {idx} [, {default}])                       *get*
+get({list}, {idx} [, {default}])                       *get()*
                Get item {idx} from List {list}.  When this item is not
                available return {default}.  Return zero when {default} is
                omitted.
@@ -2780,6 +2783,11 @@ isdirectory({directory})                         *isdirectory()*
                exist, or isn't a directory, the result is FALSE.  {directory}
                is any expression, which is used as a String.
 
+items({dict})                                          *items()*
+               Return a List with all the key-value pairs of {dict}.  Each
+               List item is a list with two items: the key of a {dict} entry
+               and the value of this entry.  The List is in arbitrary order.
+
 
 join({list} [, {sep}])                                 *join()*
                Join the items in {list} together into one String.
@@ -3517,12 +3525,15 @@ strftime({format} [, {time}])                           *strftime()*
 stridx({haystack}, {needle} [, {start}])               *stridx()*
                The result is a Number, which gives the byte index in
                {haystack} of the first occurrence of the String {needle}.
-               If {start} is specified, the String {needle} is searched from
-               the byte index {start} in the String {haystack}.
-               The search is done case-sensitive.
+               If {start} is specified, the search starts at index {start}.
+               This can be used to find a second match: >
+                       :let comma1 = stridx(line, ",")
+                       :let comma2 = stridx(line, ",", comma1 + 1)
+<              The search is done case-sensitive.
                For pattern searches use |match()|. 
                -1 is returned if the {needle} does not occur in {haystack}.
-               See also |strridx()|. Examples: >
+               See also |strridx()|.
+               Examples: >
                  :echo stridx("An Example", "Example")      3
                  :echo stridx("Starting point", "Start")    0
                  :echo stridx("Starting point", "start")   -1
@@ -3565,10 +3576,15 @@ strpart({src}, {start}[, {len}])                        *strpart()*
                example, to get three bytes under and after the cursor: >
                        strpart(getline(line(".")), col(".") - 1, 3)
 <
-strridx({haystack}, {needle})                          *strridx()*
-               The result is a Number, which gives the index in {haystack} of
-               the last occurrence of the String {needle}.
-               The search is done case-sensitive.
+strridx({haystack}, {needle} [, {start}])                      *strridx()*
+               The result is a Number, which gives the byte index in
+               {haystack} of the last occurrence of the String {needle}.
+               When {start} is specified, matches beyond this index are
+               ignored.  This can be used to find a match before a previous
+               match: >
+                       :let lastcomma = strridx(line, ",")
+                       :let comma2 = strridx(line, ",", lastcomma - 1)
+<              The search is done case-sensitive.
                For pattern searches use |match()|.
                -1 is returned if the {needle} does not occur in {haystack}.
                If the {needle} is empty the length of {haystack} is returned.
@@ -3742,6 +3758,11 @@ type({expr})     The result is a Number, depending on the type of {expr}:
                        :if type(myvar) == type(function("tr"))
                        :if type(myvar) == type([])
 
+values({dict})                                         *values()*
+               Return a List with all the values of {dict}.  The List is in
+               arbitrary order.
+
+
 virtcol({expr})                                                *virtcol()*
                The result is a Number, which is the screen column of the file
                position given with {expr}.  That is, the last screen position
@@ -4161,17 +4182,15 @@ Example: >
   :  echohl Title
   :  echo a:title
   :  echohl None
-  :  let idx = 1
-  :  while idx <= a:0
-  :    echo a:{idx} . ' '
-  :    let idx = idx + 1
-  :  endwhile
-  :  return idx
+  :  echo a:0 . " items:"
+  :  for s in a:000
+  :    echon ' ' . s
+  :  endfor
   :endfunction
 
 This function can then be called with: >
-  let lines = Table("Table", "line1", "line2")
-  let lines = Table("Empty Table")
+  call Table("Table", "line1", "line2")
+  call Table("Empty Table")
 
 To return more than one value, pass the name of a global variable: >
   :function Compute(n1, n2, divname)
@@ -4411,7 +4430,7 @@ This would call the function "my_func_whizz(parameter)".
                        List item.
 
 :let [{name}, ..., ; {lastname}] = {expr1}
-                       Like |let-unpack| above, but the List may have more
+                       Like |:let-unpack| above, but the List may have more
                        items than there are names.  A list of the remaining
                        items is assigned to {lastname}.  If there are no
                        remaining items {lastname} is set to an empty list.
index 579068c5865dfd060ee1c78e0d65d96a9385a176..74b68e16a2e9eaebc3f2319d0325d5d806529728 100644 (file)
@@ -1,4 +1,4 @@
-*insert.txt*    For Vim version 7.0aa.  Last change: 2005 Jan 05
+*insert.txt*    For Vim version 7.0aa.  Last change: 2005 Jan 26
 
 
                  VIM REFERENCE MANUAL    by Bram Moolenaar
@@ -53,7 +53,8 @@ char          action  ~
                yourself to use CTRL-[.
                                                *i_CTRL-C*
 CTRL-C         Quit insert mode, go back to Normal mode.  Do not check for
-               abbreviations.
+               abbreviations.  Does not trigger the |InsertLeave| autocommand
+               event.
 
                                                *i_CTRL-@*
 CTRL-@         Insert previously inserted text and stop insert.  {Vi: only
index 62b6de999ffe892649039ea5fec1d0739ba0f642..0adbb8d3b862e70531b385011e429e5c4a6c39da 100644 (file)
@@ -1,4 +1,4 @@
-*options.txt*  For Vim version 7.0aa.  Last change: 2005 Jan 14
+*options.txt*  For Vim version 7.0aa.  Last change: 2005 Jan 26
 
 
                  VIM REFERENCE MANUAL    by Bram Moolenaar
@@ -2738,7 +2738,7 @@ A jump table for the options with a short description can be found at |Q_op|.
        A pattern that is used to recognize a list header.  This is used for
        the "n" flag in 'formatoptions'.
        The pattern must match exactly the text that will be the indent for
-       the line below it.  You can use |\ze| to mark the end of the match
+       the line below it.  You can use |/\ze| to mark the end of the match
        while still checking more characters.  There must be a character
        following the pattern, when it matches the whole line it is handled
        like there is no match.
@@ -4656,7 +4656,7 @@ A jump table for the options with a short description can be found at |Q_op|.
        List of items that control the format of the output of |:hardcopy|.
        See |popt-option|.
 
-                                               *'quoteescape''* *'qe'*
+                                               *'quoteescape'* *'qe'*
 'quoteescape' 'qe'     string  (default "\")
                        local to buffer
                        {not in Vi}
index 21c9f57c09bdc53950afb7fb899e99638ecaf60e..2ff676ac2d5e1707a05cb134bd65727b830f0854 100644 (file)
@@ -1,4 +1,4 @@
-*pattern.txt*   For Vim version 7.0aa.  Last change: 2005 Jan 24
+*pattern.txt*   For Vim version 7.0aa.  Last change: 2005 Jan 26
 
 
                  VIM REFERENCE MANUAL    by Bram Moolenaar
@@ -1027,7 +1027,7 @@ x A single character, with no special meaning, matches itself
 <      Matches the words "r", "re", "ro", "rea", "roa", "read" and "road".
        {not available when compiled without the +syntax feature}
 
-                               */\%d* */\%x* */\%o* */\%u* */\%U/* *E678*
+                               */\%d* */\%x* */\%o* */\%u* */\%U* *E678*
 
 \%d123 Matches the character specified with a decimal number.  Must be
        followed by a non-digit.
index 4e8243dcdf29b07617d27d8fb4f6c44c72e07a36..3f202da1b8334f1709551d31e126487845bcb95f 100644 (file)
@@ -740,7 +740,7 @@ One may rename a block of files and directories by selecting them with
 the V (|linewise-visual|).
 
 
-HIDING FILES OR DIRECTORIES            *g:netrw-a* *g:netrw_list_hide*
+HIDING FILES OR DIRECTORIES            *netrw-a* *g:netrw_list_hide*
 
 Netrw's browsing facility allows one to use the hiding list in one of
 three ways: ignore it, hide files which match, and show only those files
index 583a784e4aee044705096ad40750906b5deff082..c421a229828bbd2ba812f5182ba49006246b24b0 100644 (file)
@@ -1,4 +1,4 @@
-*syntax.txt*   For Vim version 7.0aa.  Last change: 2004 Dec 09
+*syntax.txt*   For Vim version 7.0aa.  Last change: 2005 Jan 26
 
 
                  VIM REFERENCE MANUAL    by Bram Moolenaar
@@ -631,6 +631,8 @@ c_space_errors              trailing white space and spaces before a <Tab>
 c_no_trail_space_error  ... but no trailing spaces
 c_no_tab_space_error    ... but no spaces before a <Tab>
 c_no_bracket_error     don't highlight {}; inside [] as errors
+c_no_curly_error       don't highlight {}; inside [] and () as errors;
+                               except { and } in first column
 c_no_ansi              don't do standard ANSI types and constants
 c_ansi_typedefs                 ... but do standard ANSI types
 c_ansi_constants        ... but do standard ANSI constants
index ab5781e74d4f2283bde7817fcc78016ba4a4de92..e86052cbf13985f60097a36c41601037ba36176c 100644 (file)
@@ -639,7 +639,7 @@ $VIMRUNTIME starting.txt    /*$VIMRUNTIME*
 'pvw'  options.txt     /*'pvw'*
 'qe'   options.txt     /*'qe'*
 'quote motion.txt      /*'quote*
-'quoteescape'' options.txt     /*'quoteescape''*
+'quoteescape'  options.txt     /*'quoteescape'*
 'readonly'     options.txt     /*'readonly'*
 'redraw'       vi_diff.txt     /*'redraw'*
 'remap'        options.txt     /*'remap'*
@@ -1226,7 +1226,7 @@ $VIMRUNTIME       starting.txt    /*$VIMRUNTIME*
 /\%>c  pattern.txt     /*\/\\%>c*
 /\%>l  pattern.txt     /*\/\\%>l*
 /\%>v  pattern.txt     /*\/\\%>v*
-/\%U/  pattern.txt     /*\/\\%U\/*
+/\%U   pattern.txt     /*\/\\%U*
 /\%[]  pattern.txt     /*\/\\%[]*
 /\%^   pattern.txt     /*\/\\%^*
 /\%c   pattern.txt     /*\/\\%c*
@@ -1581,6 +1581,7 @@ $VIMRUNTIME       starting.txt    /*$VIMRUNTIME*
 :,     cmdline.txt     /*:,*
 :.     cmdline.txt     /*:.*
 :/     cmdline.txt     /*:\/*
+:0file editing.txt     /*:0file*
 ::.    cmdline.txt     /*::.*
 ::8    cmdline.txt     /*::8*
 ::e    cmdline.txt     /*::e*
@@ -1606,13 +1607,11 @@ $VIMRUNTIME     starting.txt    /*$VIMRUNTIME*
 :@     repeat.txt      /*:@*
 :@:    repeat.txt      /*:@:*
 :@@    repeat.txt      /*:@@*
-:Explore       pi_expl.txt     /*:Explore*
 :Man   filetype.txt    /*:Man*
 :N     editing.txt     /*:N*
 :Next  editing.txt     /*:Next*
 :P     various.txt     /*:P*
 :Print various.txt     /*:Print*
-:Sexplore      pi_expl.txt     /*:Sexplore*
 :TOhtml        syntax.txt      /*:TOhtml*
 :X     editing.txt     /*:X*
 :\bar  cmdline.txt     /*:\\bar*
@@ -4655,9 +4654,6 @@ exists()  eval.txt        /*exists()*
 expand()       eval.txt        /*expand()*
 expand-env     options.txt     /*expand-env*
 expand-environment-var options.txt     /*expand-environment-var*
-expl-starting  pi_expl.txt     /*expl-starting*
-explorer-delete        pi_expl.txt     /*explorer-delete*
-explorer-rename        pi_expl.txt     /*explorer-rename*
 expr   eval.txt        /*expr*
 expr-! eval.txt        /*expr-!*
 expr-!=        eval.txt        /*expr-!=*
@@ -4732,9 +4728,7 @@ farsi.txt farsi.txt       /*farsi.txt*
 fasm.vim       syntax.txt      /*fasm.vim*
 feature-list   eval.txt        /*feature-list*
 fetch  pi_netrw.txt    /*fetch*
-file-browser   pi_expl.txt     /*file-browser*
 file-browser-5.2       version5.txt    /*file-browser-5.2*
-file-explorer  pi_expl.txt     /*file-explorer*
 file-formats   editing.txt     /*file-formats*
 file-pattern   autocmd.txt     /*file-pattern*
 file-read      insert.txt      /*file-read*
@@ -4850,22 +4844,6 @@ g'a      motion.txt      /*g'a*
 g,     motion.txt      /*g,*
 g0     motion.txt      /*g0*
 g8     various.txt     /*g8*
-g:explDateFormat       pi_expl.txt     /*g:explDateFormat*
-g:explDetailedHelp     pi_expl.txt     /*g:explDetailedHelp*
-g:explDetailedList     pi_expl.txt     /*g:explDetailedList*
-g:explDirsFirst        pi_expl.txt     /*g:explDirsFirst*
-g:explFileHandler      pi_expl.txt     /*g:explFileHandler*
-g:explHideFiles        pi_expl.txt     /*g:explHideFiles*
-g:explSortBy   pi_expl.txt     /*g:explSortBy*
-g:explSplitBelow       pi_expl.txt     /*g:explSplitBelow*
-g:explSplitRight       pi_expl.txt     /*g:explSplitRight*
-g:explStartBelow       pi_expl.txt     /*g:explStartBelow*
-g:explStartRight       pi_expl.txt     /*g:explStartRight*
-g:explSuffixesLast     pi_expl.txt     /*g:explSuffixesLast*
-g:explUseSeparators    pi_expl.txt     /*g:explUseSeparators*
-g:explVertical pi_expl.txt     /*g:explVertical*
-g:explWinSize  pi_expl.txt     /*g:explWinSize*
-g:netrw-a      pi_netrw.txt    /*g:netrw-a*
 g:netrw_list_cmd       pi_netrw.txt    /*g:netrw_list_cmd*
 g:netrw_list_hide      pi_netrw.txt    /*g:netrw_list_hide*
 g:netrw_rm_cmd pi_netrw.txt    /*g:netrw_rm_cmd*
@@ -4906,7 +4884,7 @@ g`a       motion.txt      /*g`a*
 ga     various.txt     /*ga*
 gd     pattern.txt     /*gd*
 ge     motion.txt      /*ge*
-get    eval.txt        /*get*
+get()  eval.txt        /*get()*
 getbufvar()    eval.txt        /*getbufvar()*
 getchar()      eval.txt        /*getchar()*
 getcharmod()   eval.txt        /*getcharmod()*
@@ -5314,6 +5292,7 @@ ip        motion.txt      /*ip*
 iquote motion.txt      /*iquote*
 is     motion.txt      /*is*
 isdirectory()  eval.txt        /*isdirectory()*
+items()        eval.txt        /*items()*
 iw     motion.txt      /*iw*
 i{     motion.txt      /*i{*
 i}     motion.txt      /*i}*
@@ -5593,6 +5572,7 @@ netrw-D   pi_netrw.txt    /*netrw-D*
 netrw-R        pi_netrw.txt    /*netrw-R*
 netrw-S        pi_netrw.txt    /*netrw-S*
 netrw-U        pi_netrw.txt    /*netrw-U*
+netrw-a        pi_netrw.txt    /*netrw-a*
 netrw-activate pi_netrw.txt    /*netrw-activate*
 netrw-b        pi_netrw.txt    /*netrw-b*
 netrw-bookmark pi_netrw.txt    /*netrw-bookmark*
@@ -5823,7 +5803,6 @@ php3-syntax       syntax.txt      /*php3-syntax*
 php3.vim       syntax.txt      /*php3.vim*
 phtml-syntax   syntax.txt      /*phtml-syntax*
 phtml.vim      syntax.txt      /*phtml.vim*
-pi_expl.txt    pi_expl.txt     /*pi_expl.txt*
 pi_gzip.txt    pi_gzip.txt     /*pi_gzip.txt*
 pi_netrw.txt   pi_netrw.txt    /*pi_netrw.txt*
 pi_spec.txt    pi_spec.txt     /*pi_spec.txt*
@@ -6693,6 +6672,7 @@ v_x       change.txt      /*v_x*
 v_y    change.txt      /*v_y*
 v_~    change.txt      /*v_~*
 val-variable   eval.txt        /*val-variable*
+values()       eval.txt        /*values()*
 variables      eval.txt        /*variables*
 various        various.txt     /*various*
 various-cmds   various.txt     /*various-cmds*
index a04dd30cb58ecc7888648a2d25ebba14a008f15f..eb5cc8b82c6a1b4f45fe043b3affa399f996c0f8 100644 (file)
@@ -1,4 +1,4 @@
-*various.txt*   For Vim version 7.0aa.  Last change: 2005 Jan 20
+*various.txt*   For Vim version 7.0aa.  Last change: 2005 Jan 26
 
 
                  VIM REFERENCE MANUAL    by Bram Moolenaar
@@ -492,9 +492,9 @@ K                   Run a program to lookup the keyword under the
                             :sleep 100m     "sleep for a hundred milliseconds
                             10gs            "sleep for ten seconds
 <                      Can be interrupted with CTRL-C (CTRL-Break on MS-DOS).
-                       "gs" stands for "goto sleep".  While sleeping the
-                       cursor is positioned in the text (if visible).  {not
-                       in Vi}
+                       "gs" stands for "goto sleep".
+                       While sleeping the cursor is positioned in the text,
+                       if at a visible position.  {not in Vi}
 
                                                        *g_CTRL-A*
 g CTRL-A               Only when Vim was compiled with MEM_PROFILING defined
index bb04a6b4be81730f93cd149f490dda7fa017f6bc..1712754a7a8562531b39a0d2a5244a70625d9399 100644 (file)
@@ -1,4 +1,4 @@
-*version6.txt*  For Vim version 7.0aa.  Last change: 2004 Jun 16
+*version6.txt*  For Vim version 7.0aa.  Last change: 2005 Jan 26
 
 
                  VIM REFERENCE MANUAL    by Bram Moolenaar
@@ -865,8 +865,6 @@ on a directory moves the browser to that directory.
 There are several other possibilities, such as opening a file in the preview
 window, renaming files and deleting files.
 
-See |file-explorer|.
-
 
 Editing files over a network                           *new-network-files*
 ----------------------------
index 4ba6d4a268a2724292a441cf7b0bcbe375bee085..f9616a72b9a8bc3874eafcb1678635d1bb1856e1 100644 (file)
@@ -1,4 +1,4 @@
-*windows.txt*   For Vim version 7.0aa.  Last change: 2004 Dec 29
+*windows.txt*   For Vim version 7.0aa.  Last change: 2005 Jan 26
 
 
                  VIM REFERENCE MANUAL    by Bram Moolenaar
@@ -1098,7 +1098,7 @@ help              Contains a help file.  Will only be created with the |:help|
                and can't be changed.  The 'buflisted' option will be reset
                for a help buffer.
 
-directory      Displays directory contents.  Used by the |file-explorer|
+directory      Displays directory contents.  Can be used by a file explorer
                plugin.  The buffer is created with these settings: >
                        :set buftype=nowrite
                        :set bufhidden=delete
index ee739b9e09172a4fefe3c7e5f620b0e5ffd78bf5..eef33822b78c2b1dd551e88de430b980c907ea8e 100644 (file)
@@ -1,7 +1,7 @@
 " Vim syntax file
 " Language:    C
 " Maintainer:  Bram Moolenaar <Bram@vim.org>
-" Last Change: 2004 Dec 09
+" Last Change: 2005 Jan 26
 
 " For version 5.x: Clear all syntax items
 " For version 6.x: Quit when a syntax file was already loaded
@@ -67,7 +67,13 @@ endif
 " also accept <% for {, %> for }, <: for [ and :> for ] (C99)
 " But avoid matching <::.
 syn cluster    cParenGroup     contains=cParenError,cIncluded,cSpecial,cCommentSkip,cCommentString,cComment2String,@cCommentGroup,cCommentStartError,cUserCont,cUserLabel,cBitField,cCommentSkip,cOctalZero,cCppOut,cCppOut2,cCppSkip,cFormat,cNumber,cFloat,cOctal,cOctalError,cNumbersCom
-if exists("c_no_bracket_error")
+if exists("c_no_curly_error")
+  syn region   cParen          transparent start='(' end=')' contains=ALLBUT,@cParenGroup,cCppParen,cCppString,@Spell
+  " cCppParen: same as cParen but ends at end-of-line; used in cDefine
+  syn region   cCppParen       transparent start='(' skip='\\$' excludenl end=')' end='$' contained contains=ALLBUT,@cParenGroup,cParen,cString,@Spell
+  syn match    cParenError     display ")"
+  syn match    cErrInParen     display contained "^[{}]\|^<%\|^%>"
+elseif exists("c_no_bracket_error")
   syn region   cParen          transparent start='(' end=')' contains=ALLBUT,@cParenGroup,cCppParen,cCppString,@Spell
   " cCppParen: same as cParen but ends at end-of-line; used in cDefine
   syn region   cCppParen       transparent start='(' skip='\\$' excludenl end=')' end='$' contained contains=ALLBUT,@cParenGroup,cParen,cString,@Spell
index cb2d82a8c1e79a0d610acd16d0e816077e281067..175256e64c41508ab33d46d7fac9fc09b529da82 100644 (file)
@@ -6121,8 +6121,11 @@ ins_reg()
            im_set_active(TRUE);
 # endif
     }
-    if (regname == NUL)
+    if (regname == NUL || !valid_yank_reg(regname, FALSE))
+    {
+       vim_beep();
        need_redraw = TRUE;     /* remove the '"' */
+    }
     else
     {
 #endif
index 1dea06790505cec0bb7bb0308bb9d350180725bb..e6651e38eec225510fbe79c8381fbf21a2c3cb95 100644 (file)
@@ -336,7 +336,8 @@ hash_may_resize(ht)
     else
     {
        /* Allocate an array. */
-       newarray = (hashitem_T *)alloc((unsigned)(sizeof(hashitem_T) * newsize));
+       newarray = (hashitem_T *)alloc((unsigned)
+                                             (sizeof(hashitem_T) * newsize));
        if (newarray == NULL)
        {
            /* Out of memory.  When there are NULL items still return OK.
index f53a8ecc6d8f73c4c55a442064477f2d12ac5587..f3092556dfc6dbe9969b87dee8f0e05c15be1188 100644 (file)
@@ -2407,6 +2407,7 @@ utf_head_off(base, p)
     return (int)(p - q);
 }
 
+#if defined(FEAT_EVAL) || defined(PROTO)
 /*
  * Copy a character from "*fp" to "*tp" and advance the pointers.
  */
@@ -2421,6 +2422,7 @@ mb_copy_char(fp, tp)
     *tp += l;
     *fp += l;
 }
+#endif
 
 /*
  * Return the offset from "p" to the first byte of a character.  When "p" is
index ddc0aab3deb903ecba7ccbbdeaeb2978afa63cbd..4a052925db240986de73c511d1b9723c7700e7ca 100644 (file)
--- a/src/ops.c
+++ b/src/ops.c
@@ -813,6 +813,7 @@ valid_yank_reg(regname, writing)
 /*
  * Set y_current and y_append, according to the value of "regname".
  * Cannot handle the '_' register.
+ * Must only be called with a valid register name!
  *
  * If regname is 0 and writing, use register 0
  * If regname is 0 and reading, use previous register
@@ -2996,10 +2997,11 @@ copy_yank_reg(reg)
 #endif
 
 /*
- * put contents of register "regname" into the text
- * flags: PUT_FIXINDENT        make indent look nice
- *       PUT_CURSEND   leave cursor after end of new text
- *       PUT_LINE      force linewise put (":put")
+ * Put contents of register "regname" into the text.
+ * Caller must check "regname" to be valid!
+ * "flags": PUT_FIXINDENT      make indent look nice
+ *         PUT_CURSEND         leave cursor after end of new text
+ *         PUT_LINE            force linewise put (":put")
  */
     void
 do_put(regname, dir, count, flags)
@@ -3635,6 +3637,7 @@ end:
        if (regname == '=')
            vim_free(y_array);
     }
+    /* If the cursor is past the end of the line put it at the end. */
     if (gchar_cursor() == NUL
            && curwin->w_cursor.col > 0
            && !(restart_edit || (State & INSERT)))
index 17dc5bd4071293919aaeb214a80b100070043459..2bcdf2400b74a1cc84863cf0203d6b28aeb8aeab 100644 (file)
@@ -503,8 +503,8 @@ searchit(win, buf, pos, dir, pat, count, options, pat_use)
     regmmatch_T        regmatch;
     char_u     *ptr;
     colnr_T    matchcol;
-    colnr_T    startcol;
     lpos_T     endpos;
+    lpos_T     matchpos;
     int                loop;
     pos_T      start_pos;
     int                at_first_line;
@@ -512,7 +512,6 @@ searchit(win, buf, pos, dir, pat, count, options, pat_use)
     int                match_ok;
     long       nmatched;
     int                submatch = 0;
-    linenr_T   first_lnum;
 #ifdef FEAT_SEARCH_EXTRA
     int                break_loop = FALSE;
 #else
@@ -573,9 +572,8 @@ searchit(win, buf, pos, dir, pat, count, options, pat_use)
                                           lnum += dir, at_first_line = FALSE)
            {
                /*
-                * Look for a match somewhere in the line.
+                * Look for a match somewhere in line "lnum".
                 */
-               first_lnum = lnum;
                nmatched = vim_regexec_multi(&regmatch, win, buf,
                                                            lnum, (colnr_T)0);
                /* Abort searching on an error (e.g., out of stack). */
@@ -584,13 +582,12 @@ searchit(win, buf, pos, dir, pat, count, options, pat_use)
                if (nmatched > 0)
                {
                    /* match may actually be in another line when using \zs */
-                   lnum += regmatch.startpos[0].lnum;
-                   ptr = ml_get_buf(buf, lnum, FALSE);
-                   startcol = regmatch.startpos[0].col;
+                   matchpos = regmatch.startpos[0];
                    endpos = regmatch.endpos[0];
 # ifdef FEAT_EVAL
                    submatch = first_submatch(&regmatch);
 # endif
+                   ptr = ml_get_buf(buf, lnum + matchpos.lnum, FALSE);
 
                    /*
                     * Forward search in the first line: match should be after
@@ -601,16 +598,20 @@ searchit(win, buf, pos, dir, pat, count, options, pat_use)
                    {
                        match_ok = TRUE;
                        /*
+                        * When the match starts in a next line it's certainly
+                        * past the start position.
                         * When match lands on a NUL the cursor will be put
                         * one back afterwards, compare with that position,
                         * otherwise "/$" will get stuck on end of line.
                         */
-                       while ((options & SEARCH_END)
-                               ?  (nmatched == 1
-                                   && (int)endpos.col - 1
+                       while (matchpos.lnum == 0
+                               && ((options & SEARCH_END)
+                                   ?  (nmatched == 1
+                                       && (int)endpos.col - 1
                                             < (int)start_pos.col + extra_col)
-                               : ((int)startcol - (ptr[startcol] == NUL)
-                                           < (int)start_pos.col + extra_col))
+                                   : ((int)matchpos.col
+                                                 - (ptr[matchpos.col] == NUL)
+                                           < (int)start_pos.col + extra_col)))
                        {
                            /*
                             * If vi-compatible searching, continue at the end
@@ -628,7 +629,7 @@ searchit(win, buf, pos, dir, pat, count, options, pat_use)
                                }
                                matchcol = endpos.col;
                                /* for empty match: advance one char */
-                               if (matchcol == startcol
+                               if (matchcol == matchpos.col
                                                      && ptr[matchcol] != NUL)
                                {
 #ifdef FEAT_MBYTE
@@ -642,7 +643,7 @@ searchit(win, buf, pos, dir, pat, count, options, pat_use)
                            }
                            else
                            {
-                               matchcol = startcol;
+                               matchcol = matchpos.col;
                                if (ptr[matchcol] != NUL)
                                {
 #ifdef FEAT_MBYTE
@@ -656,12 +657,13 @@ searchit(win, buf, pos, dir, pat, count, options, pat_use)
                            }
                            if (ptr[matchcol] == NUL
                                    || (nmatched = vim_regexec_multi(&regmatch,
-                                             win, buf, lnum, matchcol)) == 0)
+                                             win, buf, lnum + matchpos.lnum,
+                                             matchcol)) == 0)
                            {
                                match_ok = FALSE;
                                break;
                            }
-                           startcol = regmatch.startpos[0].col;
+                           matchpos = regmatch.startpos[0];
                            endpos = regmatch.endpos[0];
 # ifdef FEAT_EVAL
                            submatch = first_submatch(&regmatch);
@@ -669,7 +671,7 @@ searchit(win, buf, pos, dir, pat, count, options, pat_use)
 
                            /* Need to get the line pointer again, a
                             * multi-line search may have made it invalid. */
-                           ptr = ml_get_buf(buf, lnum, FALSE);
+                           ptr = ml_get_buf(buf, lnum + matchpos.lnum, FALSE);
                        }
                        if (!match_ok)
                            continue;
@@ -686,20 +688,29 @@ searchit(win, buf, pos, dir, pat, count, options, pat_use)
                        match_ok = FALSE;
                        for (;;)
                        {
-                           if (!at_first_line
-                                   || ((options & SEARCH_END)
-                                       ?  (nmatched == 1
-                                           && (int)regmatch.endpos[0].col - 1
+                           /* Remember a position that is before the start
+                            * position, we use it if it's the last match in
+                            * the line.  Always accept a position after
+                            * wrapping around. */
+                           if (loop
+                               || ((options & SEARCH_END)
+                                   ? (lnum + regmatch.endpos[0].lnum
+                                                             < start_pos.lnum
+                                       || (lnum + regmatch.endpos[0].lnum
+                                                            == start_pos.lnum
+                                            && (int)regmatch.endpos[0].col - 1
                                                                   + extra_col
-                                                       <= (int)start_pos.col)
-                                       : ((int)regmatch.startpos[0].col
+                                                       <= (int)start_pos.col))
+                                   : (lnum + regmatch.startpos[0].lnum
+                                                             < start_pos.lnum
+                                       || (lnum + regmatch.startpos[0].lnum
+                                                            == start_pos.lnum
+                                            && (int)regmatch.startpos[0].col
                                                                   + extra_col
-                                                     <= (int)start_pos.col)))
+                                                     <= (int)start_pos.col))))
                            {
-                               /* Remember this position, we use it if it's
-                                * the last match in the line. */
                                match_ok = TRUE;
-                               startcol = regmatch.startpos[0].col;
+                               matchpos = regmatch.startpos[0];
                                endpos = regmatch.endpos[0];
 # ifdef FEAT_EVAL
                                submatch = first_submatch(&regmatch);
@@ -721,7 +732,7 @@ searchit(win, buf, pos, dir, pat, count, options, pat_use)
                                    break;
                                matchcol = endpos.col;
                                /* for empty match: advance one char */
-                               if (matchcol == startcol
+                               if (matchcol == matchpos.col
                                                      && ptr[matchcol] != NUL)
                                {
 #ifdef FEAT_MBYTE
@@ -735,7 +746,10 @@ searchit(win, buf, pos, dir, pat, count, options, pat_use)
                            }
                            else
                            {
-                               matchcol = startcol;
+                               /* Stop when the match is in a next line. */
+                               if (matchpos.lnum > 0)
+                                   break;
+                               matchcol = matchpos.col;
                                if (ptr[matchcol] != NUL)
                                {
 #ifdef FEAT_MBYTE
@@ -749,12 +763,13 @@ searchit(win, buf, pos, dir, pat, count, options, pat_use)
                            }
                            if (ptr[matchcol] == NUL
                                    || (nmatched = vim_regexec_multi(&regmatch,
-                                             win, buf, lnum, matchcol)) == 0)
+                                             win, buf, lnum + matchpos.lnum,
+                                                             matchcol)) == 0)
                                break;
 
                            /* Need to get the line pointer again, a
                             * multi-line search may have made it invalid. */
-                           ptr = ml_get_buf(buf, lnum, FALSE);
+                           ptr = ml_get_buf(buf, lnum + matchpos.lnum, FALSE);
                        }
 
                        /*
@@ -767,13 +782,13 @@ searchit(win, buf, pos, dir, pat, count, options, pat_use)
 
                    if (options & SEARCH_END && !(options & SEARCH_NOOF))
                    {
-                       pos->lnum = endpos.lnum + first_lnum;
+                       pos->lnum = lnum + endpos.lnum;
                        pos->col = endpos.col - 1;
                    }
                    else
                    {
-                       pos->lnum = lnum;
-                       pos->col = startcol;
+                       pos->lnum = lnum + matchpos.lnum;
+                       pos->col = matchpos.col;
                    }
 #ifdef FEAT_VIRTUALEDIT
                    pos->coladd = 0;
@@ -781,7 +796,7 @@ searchit(win, buf, pos, dir, pat, count, options, pat_use)
                    found = 1;
 
                    /* Set variables used for 'incsearch' highlighting. */
-                   search_match_lines = endpos.lnum - (lnum - first_lnum);
+                   search_match_lines = endpos.lnum - matchpos.lnum;
                    search_match_endcol = endpos.col;
                    break;
                }
index 19cfbe57518643949cd9029d7c301a6756e12edb..6482e30c89f974fc5af8a311d0dcf8739aa5e7f9 100644 (file)
@@ -936,8 +936,8 @@ typedef struct hashtable_S
 {
     long_u     ht_mask;        /* mask used for hash value (nr of items in
                                 * array is "ht_mask" + 1) */
-    int                ht_used;        /* number of items used */
-    int                ht_filled;      /* number of items used + removed */
+    long_u     ht_used;        /* number of items used */
+    long_u     ht_filled;      /* number of items used + removed */
     int                ht_locked;      /* counter for hash_lock() */
     int                ht_error;       /* when set growing failed, can't add more
                                   items before growing works */
index 0053ec42009e558b14b94ad809f691b0e9431bb3..3362a98775b96782bb03ef3d11a2977d5297876f 100644 (file)
@@ -36,5 +36,5 @@
 #define VIM_VERSION_NODOT      "vim70aa"
 #define VIM_VERSION_SHORT      "7.0aa"
 #define VIM_VERSION_MEDIUM     "7.0aa ALPHA"
-#define VIM_VERSION_LONG       "VIM - Vi IMproved 7.0aa ALPHA (2004 Jan 25)"
-#define VIM_VERSION_LONG_DATE  "VIM - Vi IMproved 7.0aa ALPHA (2004 Jan 25, compiled "
+#define VIM_VERSION_LONG       "VIM - Vi IMproved 7.0aa ALPHA (2005 Jan 27)"
+#define VIM_VERSION_LONG_DATE  "VIM - Vi IMproved 7.0aa ALPHA (2005 Jan 27, compiled "