summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Filelist1
-rw-r--r--runtime/doc/eval.txt71
-rw-r--r--runtime/doc/options.txt11
-rw-r--r--runtime/doc/spell.txt46
-rw-r--r--runtime/doc/tags2
-rw-r--r--src/edit.c3
-rw-r--r--src/proto/spell.pro2
-rw-r--r--src/quickfix.c2
-rw-r--r--src/search.c9
-rw-r--r--src/version.h4
10 files changed, 126 insertions, 25 deletions
diff --git a/Filelist b/Filelist
index 59ec95646..b20db506b 100644
--- 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 \
diff --git a/runtime/doc/eval.txt b/runtime/doc/eval.txt
index b2ca19944..90a8bfbe8 100644
--- a/runtime/doc/eval.txt
+++ b/runtime/doc/eval.txt
@@ -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}.
diff --git a/runtime/doc/options.txt b/runtime/doc/options.txt
index 43cc7cd7e..31cd14076 100644
--- a/runtime/doc/options.txt
+++ b/runtime/doc/options.txt
@@ -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.
diff --git a/runtime/doc/spell.txt b/runtime/doc/spell.txt
index dc0ded005..68ecb0ebe 100644
--- a/runtime/doc/spell.txt
+++ b/runtime/doc/spell.txt
@@ -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
diff --git a/runtime/doc/tags b/runtime/doc/tags
index 0b1784092..bc07faa90 100644
--- a/runtime/doc/tags
+++ b/runtime/doc/tags
@@ -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*
diff --git a/src/edit.c b/src/edit.c
index 5809df1bb..3ad12a7a6 100644
--- a/src/edit.c
+++ b/src/edit.c
@@ -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
diff --git a/src/proto/spell.pro b/src/proto/spell.pro
index 16eb19d32..9fc7a7433 100644
--- a/src/proto/spell.pro
+++ b/src/proto/spell.pro
@@ -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));
diff --git a/src/quickfix.c b/src/quickfix.c
index 2d83f1fcf..bc4ef1c6a 100644
--- a/src/quickfix.c
+++ b/src/quickfix.c
@@ -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;
diff --git a/src/search.c b/src/search.c
index 163605c55..12751f811 100644
--- a/src/search.c
+++ b/src/search.c
@@ -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();
+ }
+
}
}
}
diff --git a/src/version.h b/src/version.h
index 5703a0601..5c288aada 100644
--- a/src/version.h
+++ b/src/version.h
@@ -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 "