]> git.ipfire.org Git - thirdparty/vim.git/commitdiff
updated for version 7.0214
authorBram Moolenaar <Bram@vim.org>
Sat, 4 Mar 2006 21:55:31 +0000 (21:55 +0000)
committerBram Moolenaar <Bram@vim.org>
Sat, 4 Mar 2006 21:55:31 +0000 (21:55 +0000)
Filelist
runtime/doc/eval.txt
runtime/doc/options.txt
runtime/doc/spell.txt
runtime/doc/tags
src/edit.c
src/proto/spell.pro
src/quickfix.c
src/search.c
src/version.h

index 59ec95646b3d061e391eab685ac61b01eb72232d..b20db506b4401d337f7b5933a15a7f67f73cb8cb 100644 (file)
--- a/Filelist
+++ b/Filelist
@@ -675,6 +675,7 @@ LANG_GEN = \
                runtime/spell/??/main.aap \
                runtime/spell/yi/README.txt \
                runtime/spell/main.aap \
+               runtime/spell/cleanadd.vim \
                runtime/spell/*.vim \
                runtime/spell/fixdup \
 
index b2ca19944725f6dd9401da724a8ece9644517f72..90a8bfbe8d7e6529ebd22c528fef0f8b2599e9b4 100644 (file)
@@ -1,4 +1,4 @@
-*eval.txt*      For Vim version 7.0aa.  Last change: 2006 Mar 03
+*eval.txt*      For Vim version 7.0aa.  Last change: 2006 Mar 04
 
 
                  VIM REFERENCE MANUAL    by Bram Moolenaar
@@ -1718,6 +1718,8 @@ winheight( {nr})          Number  height of window {nr}
 winline()                      Number  window line of the cursor
 winnr( [{expr}])               Number  number of current window
 winrestcmd()                   String  returns command to restore window sizes
+winrestview({dict})            None    restore view of current window
+winsaveview()                  Dict    save view of current window
 winwidth( {nr})                        Number  width of window {nr}
 writefile({list}, {fname} [, {binary}])
                                Number  write list of lines to file {fname}
@@ -3670,7 +3672,8 @@ printf({fmt}, {expr1} ...)                                *printf()*
 pumvisible()                                           *pumvisible()*
                Returns non-zero when the popup menu is visible, zero
                otherwise.  See |ins-completion-menu|.
-
+               This can be used to avoid some things that would remove the
+               popup menu.
 
                                                        *E726* *E727*
 range({expr} [, {max} [, {stride}]])                           *range()*
@@ -3858,11 +3861,13 @@ search({pattern} [, {flags} [, {stopline}]])                    *search()*
 
                {flags} is a String, which can contain these character flags:
                'b'     search backward instead of forward
+               'c'     accept a match at the cursor position
+               'e'     move to the End of the match
                'n'     do Not move the cursor
+               'p'     return number of matching sub-pattern (see below)
+               's'     set the ' mark at the previous location of the cursor
                'w'     wrap around the end of the file
                'W'     don't wrap around the end of the file
-               's'     set the ' mark at the previous location of the cursor
-               'c'     accept a match at the cursor position
                If neither 'w' or 'W' is given, the 'wrapscan' option applies.
 
                If the 's' flag is supplied, the ' mark is set, only if the
@@ -3877,13 +3882,16 @@ search({pattern} [, {flags} [, {stopline}]])                    *search()*
 <              When {stopline} is used and it is not zero this also implies
                that the search does not wrap around the end of the file.
 
-               When a match has been found its line number is returned.
-               The cursor will be positioned at the match, unless the 'n'
-               flag is used.
                If there is no match a 0 is returned and the cursor doesn't
                move.  No error message is given.
+               When a match has been found its line number is returned.  With
+               the 'p' flag the returned value is one more than the first
+               sub-match in \(\).  One if there is none.
                To get the column number too use |searchpos()|.
 
+               The cursor will be positioned at the match, unless the 'n'
+               flag is used.
+
                Example (goes over all files in the argument list): >
                    :let n = 1
                    :while n <= argc()      " loop over all files in arglist
@@ -3900,6 +3908,19 @@ search({pattern} [, {flags} [, {stopline}]])                     *search()*
                    :  let n = n + 1
                    :endwhile
 <
+               Example for using some flags: >
+                   :echo search('\<if\|\(else\)\|\(endif\)', 'ncpe')
+<              This will search for the keywords "if", "else", and "endif"
+               under or after the cursor.  Because of the 'p' flag, it
+               returns 1, 2, or 3 depending on which keyword is found, or 0
+               if the search fails.  With the cursor on the first word of the
+               line:
+                   if (foo == 0) | let foo = foo + 1 | endif ~
+               the function returns 1.  Without the 'c' flag, the function
+               finds the "endif" and returns 3.  The same thing happens
+               without the 'e' flag if the cursor is on the "f" of "if".
+               The 'n' flag tells the function not to move the cursor.
+
 
 searchdecl({name} [, {global} [, {thisblock}]])                        *searchdecl()*
                Search for the declaration of {name}.
@@ -3939,11 +3960,12 @@ searchpair({start}, {middle}, {end} [, {flags} [, {skip} [, {stopline}]]])
                        searchpair('\<if\>', '\<else\>', '\<endif\>')
 <              By leaving {middle} empty the "else" is skipped.
 
-               {flags} are used like with |search()|.  Additionally:
+               {flags} 'b', 'c', 'n', 's', 'w' and 'W' are used like with
+               |search()|.  Additionally:
                'r'     Repeat until no more matches found; will find the
                        outer pair
                'm'     return number of Matches instead of line number with
-                       the match; will only be > 1 when 'r' is used.
+                       the match; will be > 1 when 'r' is used.
 
                When a match for {start}, {middle} or {end} is found, the
                {skip} expression is evaluated with the cursor positioned on
@@ -4764,11 +4786,40 @@ winnr([{arg}])  The result is a Number, which is the number of the current
                                                        *winrestcmd()*
 winrestcmd()   Returns a sequence of |:resize| commands that should restore
                the current window sizes.  Only works properly when no windows
-               are opened or closed and the current window is unchanged.
+               are opened or closed and the current window and tab page is
+               unchanged.
                Example: >
                        :let cmd = winrestcmd()
                        :call MessWithWindowSizes()
                        :exe cmd
+<
+                                                       *winrestview()*
+winrestview({dict})
+               Uses the |Dictionary| returned by |winsaveview()| to restore
+               the view of the current window.
+               If you have changed the values the result is unpredictable.
+               If the window size changed the result won't be the same.
+
+                                                       *winsaveview()*
+winsaveview()  Returns a |Dictionary| that contains information to restore
+               the view of the current window.  Use |winrestview()| to
+               restore the view.
+               This is useful if you have a mapping that jumps around in the
+               buffer and you want to go back to the original view.
+               This does not save fold information.  Use the 'foldenable'
+               option to temporarily switch of folding, so that folds are not
+               opened when moving around.
+               The return value includes:
+                       lnum            cursor line number
+                       col             cursor column
+                       coladd          cursor column offset for 'virtualedit'
+                       curswant        column for vertical movement
+                       topline         first line in the window
+                       topfill         filler lines, only in diff mode
+                       leftcol         first column displayed
+                       skipcol         columns skipped
+               Note that no option values are saved.
+
 
 winwidth({nr})                                         *winwidth()*
                The result is a Number, which is the width of window {nr}.
index 43cc7cd7e0bd897f65d5099cf8a7487ff50f36ac..31cd1407696eb048015add79fd769d16b21eb3e3 100644 (file)
@@ -1,4 +1,4 @@
-*options.txt*  For Vim version 7.0aa.  Last change: 2006 Mar 03
+*options.txt*  For Vim version 7.0aa.  Last change: 2006 Mar 04
 
 
                  VIM REFERENCE MANUAL    by Bram Moolenaar
@@ -6937,7 +6937,7 @@ A jump table for the options with a short description can be found at |Q_op|.
        Currently, these messages are given:
        >= 1    When the viminfo file is read or written.
        >= 2    When a file is ":source"'ed.
-       >= 5    Every searched tags file.
+       >= 5    Every searched tags file and include file.
        >= 8    Files for which a group of autocommands is executed.
        >= 9    Every executed autocommand.
        >= 12   Every executed function.
@@ -7159,8 +7159,8 @@ A jump table for the options with a short description can be found at |Q_op|.
                char   key        mode  ~
                 b    <BS>       Normal and Visual
                 s    <Space>    Normal and Visual
-                h    "h"        Normal and Visual
-                l    "l"        Normal and Visual
+                h    "h"        Normal and Visual (not recommended)
+                l    "l"        Normal and Visual (not recommended)
                 <    <Left>     Normal and Visual
                 >    <Right>    Normal and Visual
                 ~    "~"        Normal
@@ -7177,7 +7177,8 @@ A jump table for the options with a short description can be found at |Q_op|.
        ":map <BS> X" to make backspace delete the character in front of the
        cursor.
        When 'l' is included, you get a side effect: "yl" on an empty line
-       will include the <EOL>, so that "p" will insert a new line.
+       will include the <EOL>, so that "p" will insert a new line.  That's
+       why including 'h' and 'l' are not recommended.
        NOTE: This option is set to the Vi default value when 'compatible' is
        set and to the Vim default value when 'compatible' is reset.
 
index dc0ded005d8f467ad726947f2bc85b58a983f164..68ecb0ebe0e69d4d6d4ca3a929bf529999ecc591 100644 (file)
@@ -1,4 +1,4 @@
-*spell.txt*    For Vim version 7.0aa.  Last change: 2006 Mar 01
+*spell.txt*    For Vim version 7.0aa.  Last change: 2006 Mar 04
 
 
                  VIM REFERENCE MANUAL    by Bram Moolenaar
@@ -84,28 +84,45 @@ zG                  Like "zg" but add the word to the internal word list
 
                                                        *zw*
 zw                     Like "zg" but mark the word as a wrong (bad) word.
+                       If the word already appears in 'spellfile' it is
+                       turned into a comment line.  See |spellfile-cleanup|
+                       for getting rid of those.
 
                                                        *zW*
 zW                     Like "zw" but add the word to the internal word list
                        |internal-wordlist|.
 
+zuw                                                    *zug* *zuw*
+zug                    Undo |zw| and |zg|, remove the word from the entry in
+                       'spellfile'.  Count used as with |zg|.
+
+zuW                                                    *zuG* *zuW*
+zuG                    Undo |zW| and |zG|, remove the word from the internal
+                       word list.  Count used as with |zg|.
+
                                                        *:spe* *:spellgood*
 :[count]spe[llgood] {word}
                        Add {word} as a good word to 'spellfile', like with
-                       "zg".  Without count the first name is used, with a
+                       |zg|.  Without count the first name is used, with a
                        count of two the second entry, etc.
 
 :spe[llgood]! {word}   Add {word} as a good word to the internal word list,
-                       like with "zG".
+                       like with |zG|.
 
                                                        *:spellw* *:spellwrong*
 :[count]spellw[rong] {word}
                        Add {word} as a wrong (bad) word to 'spellfile', as
-                       with "zw".  Without count the first name is used, with
+                       with |zw|.  Without count the first name is used, with
                        a count of two the second entry, etc.
 
 :spellw[rong]! {word}  Add {word} as a wrong (bad) word to the internal word
-                       list.
+                       list, like with |zW|.
+
+:[count]spellu[ndo] {word}                             *:spellu* *:spellundo*
+                       Like |zuw|.  [count] used as with |:spellgood|.
+
+:spellu[ndo]! {word}   Like |zuW|.  [count] used as with |:spellgood|.
+
 
 After adding a word to 'spellfile' with the above commands its associated
 ".spl" file will automatically be updated and reloaded.  If you change
@@ -319,6 +336,25 @@ get an error the file may be truncated, modified or intended for another Vim
 version.
 
 
+SPELLFILE CLEANUP                                      *spellfile-cleanup*
+
+The |zw| command turns existing entries in 'spellfile' into comment lines.
+This avoids having to write a new file every time, but results in the file
+only getting longer, never shorter.  To clean up the comment lines in all
+".add" spell files do this: >
+       :runtime spell/cleanadd.vim
+
+This deletes all comment lines, except the ones that start with "##".  Use
+"##" lines to add comments that you want to keep.
+
+You can invoke this script as often as you like.  A variable is provided to
+skip updating files that have been changed recently.  Set it to the number of
+seconds that has passed since a file was changed before it will be cleaned.
+For example, to clean only files that were not changed in the last hour: >
+      let g:spell_clean_limit = 60 * 60
+The default is one second.
+
+
 WORDS
 
 Vim uses a fixed method to recognize a word.  This is independent of
index 0b1784092eee0242191b041466b55af567edd6e5..bc07faa90806e4c664ee79ca01616e337e01ec11 100644 (file)
@@ -7506,6 +7506,8 @@ winheight()       eval.txt        /*winheight()*
 winline()      eval.txt        /*winline()*
 winnr()        eval.txt        /*winnr()*
 winrestcmd()   eval.txt        /*winrestcmd()*
+winrestview()  eval.txt        /*winrestview()*
+winsaveview()  eval.txt        /*winsaveview()*
 winwidth()     eval.txt        /*winwidth()*
 word   motion.txt      /*word*
 word-count     editing.txt     /*word-count*
index 5809df1bbf0056b17687ab1c1f90814746ff343a..3ad12a7a6a463a5e846be4a186cfd7ae0aa0fca5 100644 (file)
@@ -2596,7 +2596,8 @@ ins_compl_dictionaries(dict_start, pat, flags, thesaurus)
 
        if (count == -1)
        {
-           /* Skip "\<" in the pattern, we don't use it as a RE. */
+           /* Complete from active spelling.  Skip "\<" in the pattern, we
+            * don't use it as a RE. */
            if (pat[0] == '\\' && pat[1] == '<')
                ptr = pat + 2;
            else
index 16eb19d3249d04d558ed8ac4031f8a336c8f8459..9fc7a7433f0e5a640955e73ddfd5b2ca14130bf7 100644 (file)
@@ -9,7 +9,7 @@ int spell_check_msm __ARGS((void));
 void put_bytes __ARGS((FILE *fd, long_u nr, int len));
 void ex_mkspell __ARGS((exarg_T *eap));
 void ex_spell __ARGS((exarg_T *eap));
-void spell_add_word __ARGS((char_u *word, int len, int bad, int index));
+void spell_add_word __ARGS((char_u *word, int len, int bad, int index, int undo));
 void init_spell_chartab __ARGS((void));
 int spell_check_sps __ARGS((void));
 void spell_suggest __ARGS((int count));
index 2d83f1fcf565429f85cef97280787e8ed624a10f..bc4ef1c6aee9524cf1b4400bbcbf3a67a6748e42 100644 (file)
@@ -3339,7 +3339,7 @@ get_errorlist(wp, list)
     }
 
     if (qi->qf_curlist >= qi->qf_listcount
-       || qi->qf_lists[qi->qf_curlist].qf_count == 0)
+           || qi->qf_lists[qi->qf_curlist].qf_count == 0)
        return FAIL;
 
     qfp = qi->qf_lists[qi->qf_curlist].qf_start;
index 163605c55a37ba694cbbf84446594450e9400a25..12751f811f8a023ec6a85faa6ba99efbc7896778 100644 (file)
@@ -4686,7 +4686,16 @@ find_pattern_in_path(ptr, dir, len, whole, skip_comments,
                                (char *)new_fname);
                        msg_trunc_attr(IObuff, TRUE, hl_attr(HLF_R));
                    }
+                   else
 #endif
+                        if (p_verbose >= 5)
+                   {
+                       verbose_enter();
+                       smsg((char_u *)_("Searching included file %s"),
+                                                          (char *)new_fname);
+                       verbose_leave();
+                   }
+
                }
            }
        }
index 5703a06014793f0e83c5262be19ec223870d17ef..5c288aadae4d311552f0b18ef4a905a2c01b88e0 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 (2006 Mar 3)"
-#define VIM_VERSION_LONG_DATE  "VIM - Vi IMproved 7.0aa ALPHA (2006 Mar 3, compiled "
+#define VIM_VERSION_LONG       "VIM - Vi IMproved 7.0aa ALPHA (2006 Mar 4)"
+#define VIM_VERSION_LONG_DATE  "VIM - Vi IMproved 7.0aa ALPHA (2006 Mar 4, compiled "