mirror of
https://github.com/zoriya/vim.git
synced 2025-12-19 21:55:18 +00:00
updated for version 7.0109
This commit is contained in:
@@ -1,4 +1,4 @@
|
|||||||
*eval.txt* For Vim version 7.0aa. Last change: 2005 Jul 07
|
*eval.txt* For Vim version 7.0aa. Last change: 2005 Jul 18
|
||||||
|
|
||||||
|
|
||||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||||
@@ -3979,8 +3979,10 @@ synID({lnum}, {col}, {trans}) *synID()*
|
|||||||
{lnum} and {col} in the current window.
|
{lnum} and {col} in the current window.
|
||||||
The syntax ID can be used with |synIDattr()| and
|
The syntax ID can be used with |synIDattr()| and
|
||||||
|synIDtrans()| to obtain syntax information about text.
|
|synIDtrans()| to obtain syntax information about text.
|
||||||
|
|
||||||
{col} is 1 for the leftmost column, {lnum} is 1 for the first
|
{col} is 1 for the leftmost column, {lnum} is 1 for the first
|
||||||
line.
|
line. 'synmaxcol' applies, in a longer line zero is returned.
|
||||||
|
|
||||||
When {trans} is non-zero, transparent items are reduced to the
|
When {trans} is non-zero, transparent items are reduced to the
|
||||||
item that they reveal. This is useful when wanting to know
|
item that they reveal. This is useful when wanting to know
|
||||||
the effective color. When {trans} is zero, the transparent
|
the effective color. When {trans} is zero, the transparent
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
*options.txt* For Vim version 7.0aa. Last change: 2005 Jul 11
|
*options.txt* For Vim version 7.0aa. Last change: 2005 Jul 18
|
||||||
|
|
||||||
|
|
||||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||||
@@ -5700,11 +5700,14 @@ A jump table for the options with a short description can be found at |Q_op|.
|
|||||||
region by listing them: "en_us,en_ca" supports both US and Canadian
|
region by listing them: "en_us,en_ca" supports both US and Canadian
|
||||||
English, but not words specific for Australia, New Zealand or Great
|
English, but not words specific for Australia, New Zealand or Great
|
||||||
Britain.
|
Britain.
|
||||||
As a special case the name of a .spl file can be given as-is. This is
|
As a special case the name of a .spl file can be given as-is. The
|
||||||
mainly for testing purposes. You must make sure the correct encoding
|
first "_xx" in the name is removed and used as the region name
|
||||||
is used, Vim doesn't check it.
|
(_xx is an underscore, two letters and followed by a non-letter).
|
||||||
|
This is mainly for testing purposes. You must make sure the correct
|
||||||
|
encoding is used, Vim doesn't check it.
|
||||||
When 'encoding' is set the word lists are reloaded. Thus it's a good
|
When 'encoding' is set the word lists are reloaded. Thus it's a good
|
||||||
idea to set 'spelllang' after setting 'encoding'.
|
idea to set 'spelllang' after setting 'encoding' to avoid loading the
|
||||||
|
files twice.
|
||||||
How the related spell files are found is explained here: |spell-load|.
|
How the related spell files are found is explained here: |spell-load|.
|
||||||
|
|
||||||
*'spellsuggest'* *'sps'*
|
*'spellsuggest'* *'sps'*
|
||||||
@@ -6021,10 +6024,9 @@ A jump table for the options with a short description can be found at |Q_op|.
|
|||||||
{not in Vi}
|
{not in Vi}
|
||||||
{not available when compiled without the |+syntax|
|
{not available when compiled without the |+syntax|
|
||||||
feature}
|
feature}
|
||||||
Maximum column in which to search for syntax items. With longer lines
|
Maximum column in which to search for syntax items. In long lines the
|
||||||
some parts may not be highlighted and following text may not be
|
text after this column is not highlighted and following lines may not
|
||||||
highlighted correctly (e.g., when the start or end of a region is not
|
be highlighted correctly, because the syntax state is cleared.
|
||||||
recognized because it is beyond 'synmaxcol').
|
|
||||||
This helps to avoid very slow redrawing for an XML file that is one
|
This helps to avoid very slow redrawing for an XML file that is one
|
||||||
long line.
|
long line.
|
||||||
Set to zero to remove the limit.
|
Set to zero to remove the limit.
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
*syntax.txt* For Vim version 7.0aa. Last change: 2005 Jul 05
|
*syntax.txt* For Vim version 7.0aa. Last change: 2005 Jul 18
|
||||||
|
|
||||||
|
|
||||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||||
@@ -2516,17 +2516,17 @@ It will look much better with a font in a quadratic cell size, e.g. for X: >
|
|||||||
|
|
||||||
Vim understands three types of syntax items:
|
Vim understands three types of syntax items:
|
||||||
|
|
||||||
1. Keyword.
|
1. Keyword
|
||||||
It can only contain keyword characters, according to the 'iskeyword'
|
It can only contain keyword characters, according to the 'iskeyword'
|
||||||
option. It cannot contain other syntax items. It will only match with a
|
option. It cannot contain other syntax items. It will only match with a
|
||||||
complete word (there are no keyword characters before or after the match).
|
complete word (there are no keyword characters before or after the match).
|
||||||
The keyword "if" would match in "if(a=b)", but not in "ifdef x", because
|
The keyword "if" would match in "if(a=b)", but not in "ifdef x", because
|
||||||
"(" is not a keyword character and "d" is.
|
"(" is not a keyword character and "d" is.
|
||||||
|
|
||||||
2. Match.
|
2. Match
|
||||||
This is a match with a single regexp pattern.
|
This is a match with a single regexp pattern.
|
||||||
|
|
||||||
3. Region.
|
3. Region
|
||||||
This starts at a match of the "start" regexp pattern and ends with a match
|
This starts at a match of the "start" regexp pattern and ends with a match
|
||||||
with the "end" regexp pattern. Any other text can appear in between. A
|
with the "end" regexp pattern. Any other text can appear in between. A
|
||||||
"skip" regexp pattern can be used to avoid matching the "end" pattern.
|
"skip" regexp pattern can be used to avoid matching the "end" pattern.
|
||||||
@@ -2565,13 +2565,30 @@ When several syntax items may match, these rules are used:
|
|||||||
|
|
||||||
DEFINING CASE *:syn-case* *E390*
|
DEFINING CASE *:syn-case* *E390*
|
||||||
|
|
||||||
:sy[ntax] case [match|ignore]
|
:sy[ntax] case [match | ignore]
|
||||||
This defines if the following ":syntax" commands will work with
|
This defines if the following ":syntax" commands will work with
|
||||||
matching case, when using "match", or with ignoring case, when using
|
matching case, when using "match", or with ignoring case, when using
|
||||||
"ignore". Note that any items before this are not affected, and all
|
"ignore". Note that any items before this are not affected, and all
|
||||||
items until the next ":syntax case" command are affected.
|
items until the next ":syntax case" command are affected.
|
||||||
|
|
||||||
|
|
||||||
|
SPELL CHECKING *:syn-spell*
|
||||||
|
|
||||||
|
:sy[ntax] spell [toplevel | notoplevel | default]
|
||||||
|
This defines where spell checking is to be done for text that is not
|
||||||
|
in a syntax item:
|
||||||
|
|
||||||
|
toplevel: Text is spell checked.
|
||||||
|
notoplevel: Text is not spell checked.
|
||||||
|
default: When there is a @Spell cluster no spell checking.
|
||||||
|
|
||||||
|
For text in syntax items use the @Spell and @NoSpell clusters
|
||||||
|
|spell-syntax|. When there is no @Spell and no @NoSpell cluster then
|
||||||
|
spell checking is done for "default" and "toplevel".
|
||||||
|
|
||||||
|
To activate spell checking the 'spell' option must be set.
|
||||||
|
|
||||||
|
|
||||||
DEFINING KEYWORDS *:syn-keyword*
|
DEFINING KEYWORDS *:syn-keyword*
|
||||||
|
|
||||||
:sy[ntax] keyword {group-name} [{options}] {keyword} .. [{options}]
|
:sy[ntax] keyword {group-name} [{options}] {keyword} .. [{options}]
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
*todo.txt* For Vim version 7.0aa. Last change: 2005 Jul 13
|
*todo.txt* For Vim version 7.0aa. Last change: 2005 Jul 18
|
||||||
|
|
||||||
|
|
||||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||||
@@ -30,9 +30,11 @@ be worked on, but only if you sponsor Vim development. See |sponsor|.
|
|||||||
*known-bugs*
|
*known-bugs*
|
||||||
-------------------- Known bugs and current work -----------------------
|
-------------------- Known bugs and current work -----------------------
|
||||||
|
|
||||||
Use vim_strncpy() in more places.
|
"at" and "it" text objects: recognize HTML/SGML/XML tag pairs <b>asdf</b>
|
||||||
|
|
||||||
When going over 'synmaxcol' don't highlight anything, stop regions.
|
":e *.foo" completion with file name starting with "+" should be escaped.
|
||||||
|
|
||||||
|
VMS patch for term.c also in Vim 6.3 (Zoltan Arpadffy)
|
||||||
|
|
||||||
Add extra list of file locations. Can be used with:
|
Add extra list of file locations. Can be used with:
|
||||||
:ltag list of matching tags, like :tselect
|
:ltag list of matching tags, like :tselect
|
||||||
@@ -93,6 +95,7 @@ Awaiting response:
|
|||||||
- Win32: tearoff menu window should have a scrollbar when it's taller than
|
- Win32: tearoff menu window should have a scrollbar when it's taller than
|
||||||
the screen.
|
the screen.
|
||||||
|
|
||||||
|
mblen(NULL, 0) also in Vim 6.3?
|
||||||
|
|
||||||
|
|
||||||
PLANNED FOR VERSION 7.0:
|
PLANNED FOR VERSION 7.0:
|
||||||
@@ -1242,6 +1245,8 @@ Help:
|
|||||||
|
|
||||||
|
|
||||||
User Friendlier:
|
User Friendlier:
|
||||||
|
8 Windows install with NSIS: make it possible to do a silent install, see
|
||||||
|
http://nsis.sourceforge.net/Docs/Chapter4.html#4.12
|
||||||
8 Windows install with install.exe: Use .exe instead of .bat files for
|
8 Windows install with install.exe: Use .exe instead of .bat files for
|
||||||
links, so that command line arguments are passed on unmodified? (Walter
|
links, so that command line arguments are passed on unmodified? (Walter
|
||||||
Briscoe)
|
Briscoe)
|
||||||
@@ -2081,12 +2086,6 @@ GUI:
|
|||||||
7 Support "-visual <type>" command line argument.
|
7 Support "-visual <type>" command line argument.
|
||||||
|
|
||||||
|
|
||||||
VMS:
|
|
||||||
- Improvement: rewrite term/TTY handling.
|
|
||||||
- Improvement: create VMS GTK runtime libraries on OpenVMS 7.1-2 (today GTK
|
|
||||||
works just on 7.3).
|
|
||||||
|
|
||||||
|
|
||||||
Autocommands:
|
Autocommands:
|
||||||
7 For autocommand events that trigger multiple times per buffer (e.g.,
|
7 For autocommand events that trigger multiple times per buffer (e.g.,
|
||||||
CursorHold), go through the list once and cache the result for a specific
|
CursorHold), go through the list once and cache the result for a specific
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
*version7.txt* For Vim version 7.0aa. Last change: 2005 Jul 12
|
*version7.txt* For Vim version 7.0aa. Last change: 2005 Jul 13
|
||||||
|
|
||||||
|
|
||||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||||
@@ -448,6 +448,8 @@ Pascal indent file. (Neil Carter)
|
|||||||
|
|
||||||
Many filetype plugins and others from Nikolai Weibull.
|
Many filetype plugins and others from Nikolai Weibull.
|
||||||
|
|
||||||
|
Xquery syntax file. (Jean-Marc Vanel)
|
||||||
|
|
||||||
Moved all the indent settings from the filetype plugin to the indent file.
|
Moved all the indent settings from the filetype plugin to the indent file.
|
||||||
Implemented b:undo_indent to undo indent settings when setting 'filetype' to a
|
Implemented b:undo_indent to undo indent settings when setting 'filetype' to a
|
||||||
different value.
|
different value.
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
" Vim support file to detect file types
|
" Vim support file to detect file types
|
||||||
"
|
"
|
||||||
" Maintainer: Bram Moolenaar <Bram@vim.org>
|
" Maintainer: Bram Moolenaar <Bram@vim.org>
|
||||||
" Last Change: 2005 Jul 04
|
" Last Change: 2005 Jul 13
|
||||||
|
|
||||||
" Listen very carefully, I will say this only once
|
" Listen very carefully, I will say this only once
|
||||||
if exists("did_load_filetypes")
|
if exists("did_load_filetypes")
|
||||||
@@ -1812,6 +1812,9 @@ au BufNewFile,BufRead *.ts,*.ui setf xml
|
|||||||
" Xdg menus
|
" Xdg menus
|
||||||
au BufNewFile,BufRead /etc/xdg/menus/*.menu setf xml
|
au BufNewFile,BufRead /etc/xdg/menus/*.menu setf xml
|
||||||
|
|
||||||
|
" Xquery
|
||||||
|
au BufNewFile,BufRead *.xq,*.xql,*.xqm,*.xquery,*.xqy setf xquery
|
||||||
|
|
||||||
" XSD
|
" XSD
|
||||||
au BufNewFile,BufRead *.xsd setf xsd
|
au BufNewFile,BufRead *.xsd setf xsd
|
||||||
|
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
" Language: HTML
|
" Language: HTML
|
||||||
" Maintainer: Claudio Fleiner <claudio@fleiner.com>
|
" Maintainer: Claudio Fleiner <claudio@fleiner.com>
|
||||||
" URL: http://www.fleiner.com/vim/syntax/html.vim
|
" URL: http://www.fleiner.com/vim/syntax/html.vim
|
||||||
" Last Change: 2005 Jul 05
|
" Last Change: 2005 Jul 18
|
||||||
|
|
||||||
" Please check :help html.vim for some comments and a description of the options
|
" Please check :help html.vim for some comments and a description of the options
|
||||||
|
|
||||||
@@ -27,6 +27,8 @@ endif
|
|||||||
|
|
||||||
syn case ignore
|
syn case ignore
|
||||||
|
|
||||||
|
syn spell toplevel
|
||||||
|
|
||||||
" mark illegal characters
|
" mark illegal characters
|
||||||
syn match htmlError "[<>&]"
|
syn match htmlError "[<>&]"
|
||||||
|
|
||||||
@@ -35,8 +37,8 @@ syn match htmlError "[<>&]"
|
|||||||
syn region htmlString contained start=+"+ end=+"+ contains=htmlSpecialChar,javaScriptExpression,@htmlPreproc
|
syn region htmlString contained start=+"+ end=+"+ contains=htmlSpecialChar,javaScriptExpression,@htmlPreproc
|
||||||
syn region htmlString contained start=+'+ end=+'+ contains=htmlSpecialChar,javaScriptExpression,@htmlPreproc
|
syn region htmlString contained start=+'+ end=+'+ contains=htmlSpecialChar,javaScriptExpression,@htmlPreproc
|
||||||
syn match htmlValue contained "=[\t ]*[^'" \t>][^ \t>]*"hs=s+1 contains=javaScriptExpression,@htmlPreproc
|
syn match htmlValue contained "=[\t ]*[^'" \t>][^ \t>]*"hs=s+1 contains=javaScriptExpression,@htmlPreproc
|
||||||
syn region htmlEndTag start=+</+ end=+>+ contains=htmlTagN,htmlTagError,@NoSpell
|
syn region htmlEndTag start=+</+ end=+>+ contains=htmlTagN,htmlTagError
|
||||||
syn region htmlTag start=+<[^/]+ end=+>+ contains=htmlTagN,htmlString,htmlArg,htmlValue,htmlTagError,htmlEvent,htmlCssDefinition,@htmlPreproc,@htmlArgCluster,@NoSpell
|
syn region htmlTag start=+<[^/]+ end=+>+ contains=htmlTagN,htmlString,htmlArg,htmlValue,htmlTagError,htmlEvent,htmlCssDefinition,@htmlPreproc,@htmlArgCluster
|
||||||
syn match htmlTagN contained +<\s*[-a-zA-Z0-9]\++hs=s+1 contains=htmlTagName,htmlSpecialTagName,@htmlTagNameCluster
|
syn match htmlTagN contained +<\s*[-a-zA-Z0-9]\++hs=s+1 contains=htmlTagName,htmlSpecialTagName,@htmlTagNameCluster
|
||||||
syn match htmlTagN contained +</\s*[-a-zA-Z0-9]\++hs=s+2 contains=htmlTagName,htmlSpecialTagName,@htmlTagNameCluster
|
syn match htmlTagN contained +</\s*[-a-zA-Z0-9]\++hs=s+2 contains=htmlTagName,htmlSpecialTagName,@htmlTagNameCluster
|
||||||
syn match htmlTagError contained "[^>]<"ms=s+1
|
syn match htmlTagError contained "[^>]<"ms=s+1
|
||||||
@@ -116,7 +118,7 @@ syn match htmlPreProcAttrName contained "\(expr\|errmsg\|sizefmt\|timefmt\|var\|
|
|||||||
|
|
||||||
if !exists("html_no_rendering")
|
if !exists("html_no_rendering")
|
||||||
" rendering
|
" rendering
|
||||||
syn cluster htmlTop contains=htmlTag,htmlEndTag,htmlSpecialChar,htmlPreProc,htmlComment,htmlLink,javaScript,@htmlPreproc
|
syn cluster htmlTop contains=@Spell,htmlTag,htmlEndTag,htmlSpecialChar,htmlPreProc,htmlComment,htmlLink,javaScript,@htmlPreproc
|
||||||
|
|
||||||
syn region htmlBold start="<b\>" end="</b>"me=e-4 contains=@htmlTop,htmlBoldUnderline,htmlBoldItalic
|
syn region htmlBold start="<b\>" end="</b>"me=e-4 contains=@htmlTop,htmlBoldUnderline,htmlBoldItalic
|
||||||
syn region htmlBold start="<strong\>" end="</strong>"me=e-9 contains=@htmlTop,htmlBoldUnderline,htmlBoldItalic
|
syn region htmlBold start="<strong\>" end="</strong>"me=e-9 contains=@htmlTop,htmlBoldUnderline,htmlBoldItalic
|
||||||
@@ -146,7 +148,7 @@ if !exists("html_no_rendering")
|
|||||||
syn region htmlItalicUnderlineBold contained start="<b\>" end="</b>"me=e-4 contains=@htmlTop
|
syn region htmlItalicUnderlineBold contained start="<b\>" end="</b>"me=e-4 contains=@htmlTop
|
||||||
syn region htmlItalicUnderlineBold contained start="<strong\>" end="</strong>"me=e-9 contains=@htmlTop
|
syn region htmlItalicUnderlineBold contained start="<strong\>" end="</strong>"me=e-9 contains=@htmlTop
|
||||||
|
|
||||||
syn region htmlLink start="<a\>\_[^>]*\<href\>" end="</a>"me=e-4 contains=htmlTag,htmlEndTag,htmlSpecialChar,htmlPreProc,htmlComment,javaScript,@htmlPreproc
|
syn region htmlLink start="<a\>\_[^>]*\<href\>" end="</a>"me=e-4 contains=@Spell,htmlTag,htmlEndTag,htmlSpecialChar,htmlPreProc,htmlComment,javaScript,@htmlPreproc
|
||||||
syn region htmlH1 start="<h1\>" end="</h1>"me=e-5 contains=@htmlTop
|
syn region htmlH1 start="<h1\>" end="</h1>"me=e-5 contains=@htmlTop
|
||||||
syn region htmlH2 start="<h2\>" end="</h2>"me=e-5 contains=@htmlTop
|
syn region htmlH2 start="<h2\>" end="</h2>"me=e-5 contains=@htmlTop
|
||||||
syn region htmlH3 start="<h3\>" end="</h3>"me=e-5 contains=@htmlTop
|
syn region htmlH3 start="<h3\>" end="</h3>"me=e-5 contains=@htmlTop
|
||||||
@@ -154,7 +156,7 @@ if !exists("html_no_rendering")
|
|||||||
syn region htmlH5 start="<h5\>" end="</h5>"me=e-5 contains=@htmlTop
|
syn region htmlH5 start="<h5\>" end="</h5>"me=e-5 contains=@htmlTop
|
||||||
syn region htmlH6 start="<h6\>" end="</h6>"me=e-5 contains=@htmlTop
|
syn region htmlH6 start="<h6\>" end="</h6>"me=e-5 contains=@htmlTop
|
||||||
syn region htmlHead start="<head\>" end="</head>"me=e-7 end="<body\>"me=e-5 end="<h[1-6]\>"me=e-3 contains=htmlTag,htmlEndTag,htmlSpecialChar,htmlPreProc,htmlComment,htmlLink,htmlTitle,javaScript,cssStyle,@htmlPreproc
|
syn region htmlHead start="<head\>" end="</head>"me=e-7 end="<body\>"me=e-5 end="<h[1-6]\>"me=e-3 contains=htmlTag,htmlEndTag,htmlSpecialChar,htmlPreProc,htmlComment,htmlLink,htmlTitle,javaScript,cssStyle,@htmlPreproc
|
||||||
syn region htmlTitle start="<title\>" end="</title>"me=e-8 contains=htmlTag,htmlEndTag,htmlSpecialChar,htmlPreProc,htmlComment,javaScript,@htmlPreproc
|
syn region htmlTitle start="<title\>" end="</title>"me=e-8 contains=@Spell,htmlTag,htmlEndTag,htmlSpecialChar,htmlPreProc,htmlComment,javaScript,@htmlPreproc
|
||||||
endif
|
endif
|
||||||
|
|
||||||
syn keyword htmlTagName contained noscript
|
syn keyword htmlTagName contained noscript
|
||||||
|
|||||||
@@ -2080,7 +2080,7 @@ print_cmd_line_help(void)
|
|||||||
printf(" or $HOME directory\n");
|
printf(" or $HOME directory\n");
|
||||||
#ifdef WIN3264
|
#ifdef WIN3264
|
||||||
printf("-register-OLE");
|
printf("-register-OLE");
|
||||||
printf(" Register gvim for OLE\n");
|
printf(" Ignored\n");
|
||||||
#endif
|
#endif
|
||||||
printf("\n");
|
printf("\n");
|
||||||
}
|
}
|
||||||
|
|||||||
18
src/edit.c
18
src/edit.c
@@ -1970,8 +1970,7 @@ ins_compl_add_infercase(str, len, fname, dir, reuse)
|
|||||||
{
|
{
|
||||||
/* Infer case of completed part -- webb */
|
/* Infer case of completed part -- webb */
|
||||||
/* Use IObuff, str would change text in buffer! */
|
/* Use IObuff, str would change text in buffer! */
|
||||||
STRNCPY(IObuff, str, len);
|
vim_strncpy(IObuff, str, len);
|
||||||
IObuff[len] = NUL;
|
|
||||||
|
|
||||||
/* Rule 1: Were any chars converted to lower? */
|
/* Rule 1: Were any chars converted to lower? */
|
||||||
for (idx = 0; idx < completion_length; ++idx)
|
for (idx = 0; idx < completion_length; ++idx)
|
||||||
@@ -2010,7 +2009,7 @@ ins_compl_add_infercase(str, len, fname, dir, reuse)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Copy the original case of the part we typed */
|
/* Copy the original case of the part we typed */
|
||||||
STRNCPY(IObuff, original_text, completion_length);
|
vim_strncpy(IObuff, original_text, completion_length);
|
||||||
|
|
||||||
return ins_compl_add(IObuff, len, fname, dir, reuse);
|
return ins_compl_add(IObuff, len, fname, dir, reuse);
|
||||||
}
|
}
|
||||||
@@ -3053,17 +3052,17 @@ ins_compl_get_exp(ini, dir)
|
|||||||
tmp_ptr = find_word_end(tmp_ptr);
|
tmp_ptr = find_word_end(tmp_ptr);
|
||||||
if (tmp_ptr > ptr)
|
if (tmp_ptr > ptr)
|
||||||
{
|
{
|
||||||
if (*ptr != ')' && IObuff[len-1] != TAB)
|
if (*ptr != ')' && IObuff[len - 1] != TAB)
|
||||||
{
|
{
|
||||||
if (IObuff[len-1] != ' ')
|
if (IObuff[len - 1] != ' ')
|
||||||
IObuff[len++] = ' ';
|
IObuff[len++] = ' ';
|
||||||
/* IObuf =~ "\k.* ", thus len >= 2 */
|
/* IObuf =~ "\k.* ", thus len >= 2 */
|
||||||
if (p_js
|
if (p_js
|
||||||
&& (IObuff[len-2] == '.'
|
&& (IObuff[len - 2] == '.'
|
||||||
|| (vim_strchr(p_cpo, CPO_JOINSP)
|
|| (vim_strchr(p_cpo, CPO_JOINSP)
|
||||||
== NULL
|
== NULL
|
||||||
&& (IObuff[len-2] == '?'
|
&& (IObuff[len - 2] == '?'
|
||||||
|| IObuff[len-2] == '!'))))
|
|| IObuff[len - 2] == '!'))))
|
||||||
IObuff[len++] = ' ';
|
IObuff[len++] = ' ';
|
||||||
}
|
}
|
||||||
/* copy as much as posible of the new word */
|
/* copy as much as posible of the new word */
|
||||||
@@ -3741,8 +3740,7 @@ ins_complete(c)
|
|||||||
curr_match->number, completion_matches);
|
curr_match->number, completion_matches);
|
||||||
else
|
else
|
||||||
sprintf((char *)IObuff, _("match %d"), curr_match->number);
|
sprintf((char *)IObuff, _("match %d"), curr_match->number);
|
||||||
STRNCPY(match_ref, IObuff, 30 );
|
vim_strncpy(match_ref, IObuff, 30);
|
||||||
match_ref[30] = '\0';
|
|
||||||
edit_submode_extra = match_ref;
|
edit_submode_extra = match_ref;
|
||||||
edit_submode_highl = HLF_R;
|
edit_submode_highl = HLF_R;
|
||||||
if (dollar_vcol)
|
if (dollar_vcol)
|
||||||
|
|||||||
@@ -6197,8 +6197,7 @@ dict_find(d, key, len)
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
/* Avoid a malloc/free by using buf[]. */
|
/* Avoid a malloc/free by using buf[]. */
|
||||||
STRNCPY(buf, key, len);
|
vim_strncpy(buf, key, len);
|
||||||
buf[len] = NUL;
|
|
||||||
akey = buf;
|
akey = buf;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -10681,10 +10680,7 @@ f_inputdialog(argvars, rettv)
|
|||||||
message = get_tv_string_chk(&argvars[0]);
|
message = get_tv_string_chk(&argvars[0]);
|
||||||
if (argvars[1].v_type != VAR_UNKNOWN
|
if (argvars[1].v_type != VAR_UNKNOWN
|
||||||
&& (defstr = get_tv_string_buf_chk(&argvars[1], buf)) != NULL)
|
&& (defstr = get_tv_string_buf_chk(&argvars[1], buf)) != NULL)
|
||||||
{
|
vim_strncpy(IObuff, defstr, IOSIZE - 1);
|
||||||
STRNCPY(IObuff, defstr, IOSIZE);
|
|
||||||
IObuff[IOSIZE - 1] = NUL;
|
|
||||||
}
|
|
||||||
else
|
else
|
||||||
IObuff[0] = NUL;
|
IObuff[0] = NUL;
|
||||||
if (message != NULL && defstr != NULL
|
if (message != NULL && defstr != NULL
|
||||||
|
|||||||
@@ -5511,16 +5511,14 @@ prt_open_resource(resource)
|
|||||||
switch (dsc_line.type)
|
switch (dsc_line.type)
|
||||||
{
|
{
|
||||||
case PRT_DSC_TITLE_TYPE:
|
case PRT_DSC_TITLE_TYPE:
|
||||||
STRNCPY(resource->title, dsc_line.string, dsc_line.len);
|
vim_strncpy(resource->title, dsc_line.string, dsc_line.len);
|
||||||
resource->title[dsc_line.len] = '\0';
|
|
||||||
seen_title = TRUE;
|
seen_title = TRUE;
|
||||||
if (seen_version)
|
if (seen_version)
|
||||||
seen_all = TRUE;
|
seen_all = TRUE;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case PRT_DSC_VERSION_TYPE:
|
case PRT_DSC_VERSION_TYPE:
|
||||||
STRNCPY(resource->version, dsc_line.string, dsc_line.len);
|
vim_strncpy(resource->version, dsc_line.string, dsc_line.len);
|
||||||
resource->version[dsc_line.len] = '\0';
|
|
||||||
seen_version = TRUE;
|
seen_version = TRUE;
|
||||||
if (seen_title)
|
if (seen_title)
|
||||||
seen_all = TRUE;
|
seen_all = TRUE;
|
||||||
@@ -5862,8 +5860,7 @@ prt_build_cid_fontname(font, name, name_len)
|
|||||||
fontname = (char *)alloc(name_len + 1);
|
fontname = (char *)alloc(name_len + 1);
|
||||||
if (fontname == NULL)
|
if (fontname == NULL)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
STRNCPY(fontname, name, name_len);
|
vim_strncpy((char_u *)fontname, name, name_len);
|
||||||
fontname[name_len] = '\0';
|
|
||||||
prt_ps_mb_font.ps_fontname[font] = fontname;
|
prt_ps_mb_font.ps_fontname[font] = fontname;
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
@@ -5977,7 +5974,6 @@ mch_print_init(psettings, jobname, forceit)
|
|||||||
double bottom;
|
double bottom;
|
||||||
#ifdef FEAT_MBYTE
|
#ifdef FEAT_MBYTE
|
||||||
int cmap;
|
int cmap;
|
||||||
int pmcs_len;
|
|
||||||
char_u *p_encoding;
|
char_u *p_encoding;
|
||||||
struct prt_ps_encoding_S *p_mbenc;
|
struct prt_ps_encoding_S *p_mbenc;
|
||||||
struct prt_ps_encoding_S *p_mbenc_first;
|
struct prt_ps_encoding_S *p_mbenc_first;
|
||||||
@@ -6035,7 +6031,7 @@ mch_print_init(psettings, jobname, forceit)
|
|||||||
if (prt_out_mbyte)
|
if (prt_out_mbyte)
|
||||||
{
|
{
|
||||||
/* Build CMap name - will be same for all multi-byte fonts used */
|
/* Build CMap name - will be same for all multi-byte fonts used */
|
||||||
prt_cmap[0] = '\0';
|
prt_cmap[0] = NUL;
|
||||||
|
|
||||||
prt_custom_cmap = prt_out_mbyte && p_mbchar == NULL;
|
prt_custom_cmap = prt_out_mbyte && p_mbchar == NULL;
|
||||||
|
|
||||||
@@ -6051,26 +6047,26 @@ mch_print_init(psettings, jobname, forceit)
|
|||||||
/* Add charset name if not empty */
|
/* Add charset name if not empty */
|
||||||
if (p_mbchar->cmap_charset != NULL)
|
if (p_mbchar->cmap_charset != NULL)
|
||||||
{
|
{
|
||||||
STRCAT(prt_cmap, p_mbchar->cmap_charset);
|
vim_strncpy((char_u *)prt_cmap,
|
||||||
|
(char_u *)p_mbchar->cmap_charset, sizeof(prt_cmap) - 3);
|
||||||
STRCAT(prt_cmap, "-");
|
STRCAT(prt_cmap, "-");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
/* Add custom CMap character set name */
|
/* Add custom CMap character set name */
|
||||||
pmcs_len = STRLEN(p_pmcs);
|
if (*p_pmcs == NUL)
|
||||||
if (pmcs_len == 0)
|
|
||||||
{
|
{
|
||||||
EMSG(_("E674: printmbcharset cannot be empty with multi-byte encoding."));
|
EMSG(_("E674: printmbcharset cannot be empty with multi-byte encoding."));
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
STRNCPY(prt_cmap, p_pmcs, STRLEN(p_pmcs));
|
vim_strncpy((char_u *)prt_cmap, p_pmcs, sizeof(prt_cmap) - 3);
|
||||||
prt_cmap[pmcs_len] = '\0';
|
|
||||||
STRCAT(prt_cmap, "-");
|
STRCAT(prt_cmap, "-");
|
||||||
}
|
}
|
||||||
|
|
||||||
/* CMap name ends with (optional) encoding name and -H for horizontal */
|
/* CMap name ends with (optional) encoding name and -H for horizontal */
|
||||||
if (p_mbenc->cmap_encoding != NULL)
|
if (p_mbenc->cmap_encoding != NULL && STRLEN(prt_cmap)
|
||||||
|
+ STRLEN(p_mbenc->cmap_encoding) + 3 < sizeof(prt_cmap))
|
||||||
{
|
{
|
||||||
STRCAT(prt_cmap, p_mbenc->cmap_encoding);
|
STRCAT(prt_cmap, p_mbenc->cmap_encoding);
|
||||||
STRCAT(prt_cmap, "-");
|
STRCAT(prt_cmap, "-");
|
||||||
|
|||||||
@@ -3239,10 +3239,7 @@ ExpandOne(xp, str, orig, options, mode)
|
|||||||
}
|
}
|
||||||
ss = alloc((unsigned)len + 1);
|
ss = alloc((unsigned)len + 1);
|
||||||
if (ss)
|
if (ss)
|
||||||
{
|
vim_strncpy(ss, xp->xp_files[0], (size_t)len);
|
||||||
STRNCPY(ss, xp->xp_files[0], len);
|
|
||||||
ss[len] = NUL;
|
|
||||||
}
|
|
||||||
findex = -1; /* next p_wc gets first one */
|
findex = -1; /* next p_wc gets first one */
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -3749,8 +3746,7 @@ addstar(fname, len, context)
|
|||||||
retval = alloc(len + 4);
|
retval = alloc(len + 4);
|
||||||
if (retval != NULL)
|
if (retval != NULL)
|
||||||
{
|
{
|
||||||
STRNCPY(retval, fname, len);
|
vim_strncpy(retval, fname, len);
|
||||||
retval[len] = NUL;
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Don't add a star to ~, ~user, $var or `cmd`.
|
* Don't add a star to ~, ~user, $var or `cmd`.
|
||||||
|
|||||||
@@ -1809,10 +1809,7 @@ foldAddMarker(lnum, marker, markerlen)
|
|||||||
return;
|
return;
|
||||||
STRCPY(newline, line);
|
STRCPY(newline, line);
|
||||||
if (p == NULL)
|
if (p == NULL)
|
||||||
{
|
vim_strncpy(newline + line_len, marker, markerlen);
|
||||||
STRNCPY(newline + line_len, marker, markerlen);
|
|
||||||
newline[line_len + markerlen] = NUL;
|
|
||||||
}
|
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
STRCPY(newline + line_len, cms);
|
STRCPY(newline + line_len, cms);
|
||||||
|
|||||||
@@ -1476,8 +1476,7 @@ dlg_destroy(GtkWidget *dlg)
|
|||||||
const char *text;
|
const char *text;
|
||||||
|
|
||||||
text = gtk_entry_get_text(GTK_ENTRY(dialog_textentry));
|
text = gtk_entry_get_text(GTK_ENTRY(dialog_textentry));
|
||||||
STRNCPY(dialog_textfield, text, IOSIZE);
|
vim_strncpy(dialog_textfield, (char_u *)text, IOSIZE - 1);
|
||||||
dialog_textfield[IOSIZE - 1] = NUL;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Destroy the dialog, will break the waiting loop. */
|
/* Destroy the dialog, will break the waiting loop. */
|
||||||
@@ -2340,8 +2339,7 @@ gui_mch_dialog(int type, /* type of dialog */
|
|||||||
text = (char_u *)gtk_entry_get_text(GTK_ENTRY(entry));
|
text = (char_u *)gtk_entry_get_text(GTK_ENTRY(entry));
|
||||||
text = CONVERT_FROM_UTF8(text);
|
text = CONVERT_FROM_UTF8(text);
|
||||||
|
|
||||||
STRNCPY(textfield, text, IOSIZE);
|
vim_strncpy(textfield, text, IOSIZE - 1);
|
||||||
textfield[IOSIZE - 1] = NUL;
|
|
||||||
|
|
||||||
CONVERT_FROM_UTF8_FREE(text);
|
CONVERT_FROM_UTF8_FREE(text);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2325,9 +2325,9 @@ sm_client_die(GnomeClient *client, gpointer data)
|
|||||||
/* Don't write messages to the GUI anymore */
|
/* Don't write messages to the GUI anymore */
|
||||||
full_screen = FALSE;
|
full_screen = FALSE;
|
||||||
|
|
||||||
STRNCPY(IObuff, _("Vim: Received \"die\" request from session manager\n"),
|
vim_strncpy(IObuff,
|
||||||
IOSIZE);
|
_("Vim: Received \"die\" request from session manager\n"),
|
||||||
IObuff[IOSIZE - 1] = NUL;
|
IOSIZE - 1);
|
||||||
preserve_exit();
|
preserve_exit();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -3527,9 +3527,9 @@ mainwin_destroy_cb(GtkObject *object, gpointer data)
|
|||||||
|
|
||||||
if (!exiting) /* only do anything if the destroy was unexpected */
|
if (!exiting) /* only do anything if the destroy was unexpected */
|
||||||
{
|
{
|
||||||
STRNCPY(IObuff, _("Vim: Main window unexpectedly destroyed\n"),
|
vim_strncpy(IObuff,
|
||||||
IOSIZE);
|
(char_u *)_("Vim: Main window unexpectedly destroyed\n"),
|
||||||
IObuff[IOSIZE - 1] = NUL;
|
IOSIZE - 1);
|
||||||
preserve_exit();
|
preserve_exit();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3592,8 +3592,7 @@ gui_mch_tearoff(
|
|||||||
if (label == NULL)
|
if (label == NULL)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
STRNCPY(text, menu->name, nameLen);
|
vim_strncpy(text, menu->name, nameLen);
|
||||||
text[nameLen] = NUL;
|
|
||||||
text = vim_strchr(text, TAB); /* stop at TAB before actext */
|
text = vim_strchr(text, TAB); /* stop at TAB before actext */
|
||||||
if (text == NULL)
|
if (text == NULL)
|
||||||
text = label + nameLen; /* no actext, use whole name */
|
text = label + nameLen; /* no actext, use whole name */
|
||||||
|
|||||||
@@ -698,8 +698,7 @@ set_b0_fname(b0p, buf)
|
|||||||
/* Systems that cannot translate "~user" back into a path: copy the
|
/* Systems that cannot translate "~user" back into a path: copy the
|
||||||
* file name unmodified. Do use slashes instead of backslashes for
|
* file name unmodified. Do use slashes instead of backslashes for
|
||||||
* portability. */
|
* portability. */
|
||||||
STRNCPY(b0p->b0_fname, buf->b_ffname, B0_FNAME_SIZE);
|
vim_strncpy(b0p->b0_fname, buf->b_ffname, B0_FNAME_SIZE - 1);
|
||||||
b0p->b0_fname[B0_FNAME_SIZE - 1] = NUL;
|
|
||||||
# ifdef BACKSLASH_IN_FILENAME
|
# ifdef BACKSLASH_IN_FILENAME
|
||||||
forward_slash(b0p->b0_fname);
|
forward_slash(b0p->b0_fname);
|
||||||
# endif
|
# endif
|
||||||
@@ -721,10 +720,7 @@ set_b0_fname(b0p, buf)
|
|||||||
/* If there is no user name or it is too long, don't use "~/" */
|
/* If there is no user name or it is too long, don't use "~/" */
|
||||||
if (get_user_name(uname, B0_UNAME_SIZE) == FAIL
|
if (get_user_name(uname, B0_UNAME_SIZE) == FAIL
|
||||||
|| (ulen = STRLEN(uname)) + flen > B0_FNAME_SIZE - 1)
|
|| (ulen = STRLEN(uname)) + flen > B0_FNAME_SIZE - 1)
|
||||||
{
|
vim_strncpy(b0p->b0_fname, buf->b_ffname, B0_FNAME_SIZE - 1);
|
||||||
STRNCPY(b0p->b0_fname, buf->b_ffname, B0_FNAME_SIZE);
|
|
||||||
b0p->b0_fname[B0_FNAME_SIZE - 1] = NUL;
|
|
||||||
}
|
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
mch_memmove(b0p->b0_fname + ulen + 1, b0p->b0_fname + 1, flen);
|
mch_memmove(b0p->b0_fname + ulen + 1, b0p->b0_fname + 1, flen);
|
||||||
|
|||||||
@@ -1258,8 +1258,7 @@ set_context_in_menu_cmd(xp, cmd, arg, forceit)
|
|||||||
path_name = alloc((unsigned)(after_dot - arg));
|
path_name = alloc((unsigned)(after_dot - arg));
|
||||||
if (path_name == NULL)
|
if (path_name == NULL)
|
||||||
return NULL;
|
return NULL;
|
||||||
STRNCPY(path_name, arg, after_dot - arg - 1);
|
vim_strncpy(path_name, arg, after_dot - arg - 1);
|
||||||
path_name[after_dot - arg - 1] = NUL;
|
|
||||||
}
|
}
|
||||||
name = path_name;
|
name = path_name;
|
||||||
while (name != NULL && *name)
|
while (name != NULL && *name)
|
||||||
|
|||||||
@@ -976,8 +976,7 @@ open_line(dir, flags, old_indent)
|
|||||||
lead_len = 0;
|
lead_len = 0;
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
STRNCPY(leader, saved_line, lead_len);
|
vim_strncpy(leader, saved_line, lead_len);
|
||||||
leader[lead_len] = NUL;
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Replace leader with lead_repl, right or left adjusted
|
* Replace leader with lead_repl, right or left adjusted
|
||||||
@@ -3345,8 +3344,7 @@ init_homedir()
|
|||||||
p = vim_strchr(var + 1, '%');
|
p = vim_strchr(var + 1, '%');
|
||||||
if (p != NULL)
|
if (p != NULL)
|
||||||
{
|
{
|
||||||
STRNCPY(NameBuff, var + 1, p - (var + 1));
|
vim_strncpy(NameBuff, var + 1, p - (var + 1));
|
||||||
NameBuff[p - (var + 1)] = NUL;
|
|
||||||
exp = mch_getenv(NameBuff);
|
exp = mch_getenv(NameBuff);
|
||||||
if (exp != NULL && *exp != NUL
|
if (exp != NULL && *exp != NUL
|
||||||
&& STRLEN(exp) + STRLEN(p) < MAXPATHL)
|
&& STRLEN(exp) + STRLEN(p) < MAXPATHL)
|
||||||
|
|||||||
@@ -2532,8 +2532,7 @@ op_change(oap)
|
|||||||
{
|
{
|
||||||
if ((ins_text = alloc_check((unsigned)(ins_len + 1))) != NULL)
|
if ((ins_text = alloc_check((unsigned)(ins_len + 1))) != NULL)
|
||||||
{
|
{
|
||||||
STRNCPY(ins_text, firstline + bd.textcol, ins_len);
|
vim_strncpy(ins_text, firstline + bd.textcol, (size_t)ins_len);
|
||||||
ins_text[ins_len] = NUL;
|
|
||||||
for (linenr = oap->start.lnum + 1; linenr <= oap->end.lnum;
|
for (linenr = oap->start.lnum + 1; linenr <= oap->end.lnum;
|
||||||
linenr++)
|
linenr++)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -4318,8 +4318,7 @@ skip:
|
|||||||
|
|
||||||
if (errmsg != NULL)
|
if (errmsg != NULL)
|
||||||
{
|
{
|
||||||
STRNCPY(IObuff, _(errmsg), IOSIZE - 1);
|
vim_strncpy(IObuff, (char_u *)_(errmsg), IOSIZE - 1);
|
||||||
IObuff[IOSIZE - 1] = NUL;
|
|
||||||
i = STRLEN(IObuff) + 2;
|
i = STRLEN(IObuff) + 2;
|
||||||
if (i + (arg - startarg) < IOSIZE)
|
if (i + (arg - startarg) < IOSIZE)
|
||||||
{
|
{
|
||||||
@@ -9365,7 +9364,7 @@ option_value2string(opp, opt_flags)
|
|||||||
else if ((char_u **)opp->var == &p_pt)
|
else if ((char_u **)opp->var == &p_pt)
|
||||||
str2specialbuf(p_pt, NameBuff, MAXPATHL);
|
str2specialbuf(p_pt, NameBuff, MAXPATHL);
|
||||||
else
|
else
|
||||||
STRNCPY(NameBuff, varp, MAXPATHL);
|
vim_strncpy(NameBuff, varp, MAXPATHL - 1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -626,7 +626,7 @@ mch_get_host_name(s, len)
|
|||||||
char_u *s;
|
char_u *s;
|
||||||
int len;
|
int len;
|
||||||
{
|
{
|
||||||
STRNCPY(s, "Amiga", len);
|
vim_strncpy(s, "Amiga", len - 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -690,7 +690,7 @@ mch_FullName(fname, buf, len, force)
|
|||||||
{
|
{
|
||||||
if (i < len - 1 && (i == 0 || buf[i - 1] != ':'))
|
if (i < len - 1 && (i == 0 || buf[i - 1] != ':'))
|
||||||
buf[i++] = '/';
|
buf[i++] = '/';
|
||||||
STRNCPY(buf + i, fname, len - i);
|
vim_strncpy(buf + i, fname, len - i - 1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -148,8 +148,7 @@ clip_mch_set_selection( VimClipboard *cbd )
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
STRNCPY( text_clip, str, len );
|
vim_strncpy( text_clip, str, len );
|
||||||
text_clip[ len ] = NUL;
|
|
||||||
|
|
||||||
vim_clip[ 1 ] = NUL;
|
vim_clip[ 1 ] = NUL;
|
||||||
|
|
||||||
|
|||||||
@@ -36,7 +36,7 @@ char_u *strup_save __ARGS((char_u *orig));
|
|||||||
void copy_spaces __ARGS((char_u *ptr, size_t count));
|
void copy_spaces __ARGS((char_u *ptr, size_t count));
|
||||||
void copy_chars __ARGS((char_u *ptr, size_t count, int c));
|
void copy_chars __ARGS((char_u *ptr, size_t count, int c));
|
||||||
void del_trailing_spaces __ARGS((char_u *ptr));
|
void del_trailing_spaces __ARGS((char_u *ptr));
|
||||||
void vim_strncpy __ARGS((char_u *to, char_u *from, int len));
|
void vim_strncpy __ARGS((char_u *to, char_u *from, size_t len));
|
||||||
int copy_option_part __ARGS((char_u **option, char_u *buf, int maxlen, char *sep_chars));
|
int copy_option_part __ARGS((char_u **option, char_u *buf, int maxlen, char *sep_chars));
|
||||||
void vim_free __ARGS((void *x));
|
void vim_free __ARGS((void *x));
|
||||||
int vim_stricmp __ARGS((char *s1, char *s2));
|
int vim_stricmp __ARGS((char *s1, char *s2));
|
||||||
|
|||||||
@@ -1067,6 +1067,11 @@ struct dictvar_S
|
|||||||
dict_T *dv_used_prev; /* previous dict in used dicts list */
|
dict_T *dv_used_prev; /* previous dict in used dicts list */
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/* values for b_syn_spell: what to do with toplevel text */
|
||||||
|
#define SYNSPL_DEFAULT 0 /* spell check if @Spell not defined */
|
||||||
|
#define SYNSPL_TOP 1 /* spell check toplevel text */
|
||||||
|
#define SYNSPL_NOTOP 2 /* don't spell check toplevel text */
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* buffer: structure that holds information about one file
|
* buffer: structure that holds information about one file
|
||||||
@@ -1429,6 +1434,7 @@ struct file_buffer
|
|||||||
hashtab_T b_keywtab; /* syntax keywords hash table */
|
hashtab_T b_keywtab; /* syntax keywords hash table */
|
||||||
hashtab_T b_keywtab_ic; /* idem, ignore case */
|
hashtab_T b_keywtab_ic; /* idem, ignore case */
|
||||||
int b_syn_ic; /* ignore case for :syn cmds */
|
int b_syn_ic; /* ignore case for :syn cmds */
|
||||||
|
int b_syn_spell; /* SYNSPL_ values */
|
||||||
garray_T b_syn_patterns; /* table for syntax patterns */
|
garray_T b_syn_patterns; /* table for syntax patterns */
|
||||||
garray_T b_syn_clusters; /* table for syntax clusters */
|
garray_T b_syn_clusters; /* table for syntax clusters */
|
||||||
int b_spell_cluster_id; /* @Spell cluster ID or 0 */
|
int b_spell_cluster_id; /* @Spell cluster ID or 0 */
|
||||||
|
|||||||
66
src/syntax.c
66
src/syntax.c
@@ -396,6 +396,7 @@ static char_u *syn_getcurline __ARGS((void));
|
|||||||
static int syn_regexec __ARGS((regmmatch_T *rmp, linenr_T lnum, colnr_T col));
|
static int syn_regexec __ARGS((regmmatch_T *rmp, linenr_T lnum, colnr_T col));
|
||||||
static int check_keyword_id __ARGS((char_u *line, int startcol, int *endcol, long *flags, short **next_list, stateitem_T *cur_si));
|
static int check_keyword_id __ARGS((char_u *line, int startcol, int *endcol, long *flags, short **next_list, stateitem_T *cur_si));
|
||||||
static void syn_cmd_case __ARGS((exarg_T *eap, int syncing));
|
static void syn_cmd_case __ARGS((exarg_T *eap, int syncing));
|
||||||
|
static void syn_cmd_spell __ARGS((exarg_T *eap, int syncing));
|
||||||
static void syntax_sync_clear __ARGS((void));
|
static void syntax_sync_clear __ARGS((void));
|
||||||
static void syn_remove_pattern __ARGS((buf_T *buf, int idx));
|
static void syn_remove_pattern __ARGS((buf_T *buf, int idx));
|
||||||
static void syn_clear_pattern __ARGS((buf_T *buf, int i));
|
static void syn_clear_pattern __ARGS((buf_T *buf, int i));
|
||||||
@@ -1698,6 +1699,17 @@ get_syntax_attr(col, can_spell)
|
|||||||
if (syn_buf->b_sst_array == NULL)
|
if (syn_buf->b_sst_array == NULL)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
|
/* After 'synmaxcol' the attribute is always zero. */
|
||||||
|
if (syn_buf->b_p_smc > 0 && col >= syn_buf->b_p_smc)
|
||||||
|
{
|
||||||
|
clear_current_state();
|
||||||
|
#ifdef FEAT_EVAL
|
||||||
|
current_id = 0;
|
||||||
|
current_trans_id = 0;
|
||||||
|
#endif
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
/* Make sure current_state is valid */
|
/* Make sure current_state is valid */
|
||||||
if (INVALID_STATE(¤t_state))
|
if (INVALID_STATE(¤t_state))
|
||||||
validate_current_state();
|
validate_current_state();
|
||||||
@@ -2189,13 +2201,12 @@ syn_current_attr(syncing, displaying, can_spell)
|
|||||||
* set "can_spell" to TRUE if spell checking is supposed to be
|
* set "can_spell" to TRUE if spell checking is supposed to be
|
||||||
* done in the current item.
|
* done in the current item.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if (syn_buf->b_spell_cluster_id == 0)
|
if (syn_buf->b_spell_cluster_id == 0)
|
||||||
{
|
{
|
||||||
/* There is no @Spell cluster: Do spelling for items without
|
/* There is no @Spell cluster: Do spelling for items without
|
||||||
* @NoSpell cluster. */
|
* @NoSpell cluster. */
|
||||||
if (syn_buf->b_nospell_cluster_id == 0 || current_trans_id == 0)
|
if (syn_buf->b_nospell_cluster_id == 0 || current_trans_id == 0)
|
||||||
*can_spell = TRUE;
|
*can_spell = (syn_buf->b_syn_spell != SYNSPL_NOTOP);
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
sps.inc_tag = 0;
|
sps.inc_tag = 0;
|
||||||
@@ -2207,9 +2218,11 @@ syn_current_attr(syncing, displaying, can_spell)
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
/* The @Spell cluster is defined: Do spelling in items with
|
/* The @Spell cluster is defined: Do spelling in items with
|
||||||
* the @Spell cluster. But not when @NoSpell is also there. */
|
* the @Spell cluster. But not when @NoSpell is also there.
|
||||||
|
* At the toplevel only spell check when ":syn spell toplevel"
|
||||||
|
* was used. */
|
||||||
if (current_trans_id == 0)
|
if (current_trans_id == 0)
|
||||||
*can_spell = FALSE;
|
*can_spell = (syn_buf->b_syn_spell == SYNSPL_TOP);
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
sps.inc_tag = 0;
|
sps.inc_tag = 0;
|
||||||
@@ -2248,8 +2261,11 @@ syn_current_attr(syncing, displaying, can_spell)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (can_spell != NULL)
|
else if (can_spell != NULL)
|
||||||
/* Only do spelling when there is no @Spell cluster. */
|
/* Default: Only do spelling when there is no @Spell cluster or when
|
||||||
*can_spell = (syn_buf->b_spell_cluster_id == 0);
|
* ":syn spell toplevel" was used. */
|
||||||
|
*can_spell = syn_buf->b_syn_spell == SYNSPL_DEFAULT
|
||||||
|
? (syn_buf->b_spell_cluster_id == 0)
|
||||||
|
: (syn_buf->b_syn_spell == SYNSPL_TOP);
|
||||||
|
|
||||||
/* nextgroup ends at end of line, unless "skipnl" or "skipemtpy" present */
|
/* nextgroup ends at end of line, unless "skipnl" or "skipemtpy" present */
|
||||||
if (current_next_list != NULL
|
if (current_next_list != NULL
|
||||||
@@ -3050,8 +3066,7 @@ check_keyword_id(line, startcol, endcolp, flagsp, next_listp, cur_si)
|
|||||||
* Must make a copy of the keyword, so we can add a NUL and make it
|
* Must make a copy of the keyword, so we can add a NUL and make it
|
||||||
* lowercase.
|
* lowercase.
|
||||||
*/
|
*/
|
||||||
STRNCPY(keyword, kwp, kwlen);
|
vim_strncpy(keyword, kwp, kwlen);
|
||||||
keyword[kwlen] = NUL;
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Try twice:
|
* Try twice:
|
||||||
@@ -3119,6 +3134,33 @@ syn_cmd_case(eap, syncing)
|
|||||||
EMSG2(_("E390: Illegal argument: %s"), arg);
|
EMSG2(_("E390: Illegal argument: %s"), arg);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Handle ":syntax spell" command.
|
||||||
|
*/
|
||||||
|
/* ARGSUSED */
|
||||||
|
static void
|
||||||
|
syn_cmd_spell(eap, syncing)
|
||||||
|
exarg_T *eap;
|
||||||
|
int syncing; /* not used */
|
||||||
|
{
|
||||||
|
char_u *arg = eap->arg;
|
||||||
|
char_u *next;
|
||||||
|
|
||||||
|
eap->nextcmd = find_nextcmd(arg);
|
||||||
|
if (eap->skip)
|
||||||
|
return;
|
||||||
|
|
||||||
|
next = skiptowhite(arg);
|
||||||
|
if (STRNICMP(arg, "toplevel", 8) == 0 && next - arg == 8)
|
||||||
|
curbuf->b_syn_spell = SYNSPL_TOP;
|
||||||
|
else if (STRNICMP(arg, "notoplevel", 10) == 0 && next - arg == 10)
|
||||||
|
curbuf->b_syn_spell = SYNSPL_NOTOP;
|
||||||
|
else if (STRNICMP(arg, "default", 4) == 0 && next - arg == 4)
|
||||||
|
curbuf->b_syn_spell = SYNSPL_DEFAULT;
|
||||||
|
else
|
||||||
|
EMSG2(_("E390: Illegal argument: %s"), arg);
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Clear all syntax info for one buffer.
|
* Clear all syntax info for one buffer.
|
||||||
*/
|
*/
|
||||||
@@ -3129,6 +3171,7 @@ syntax_clear(buf)
|
|||||||
int i;
|
int i;
|
||||||
|
|
||||||
buf->b_syn_ic = FALSE; /* Use case, by default */
|
buf->b_syn_ic = FALSE; /* Use case, by default */
|
||||||
|
buf->b_syn_spell = SYNSPL_DEFAULT; /* default spell checking */
|
||||||
buf->b_syn_containedin = FALSE;
|
buf->b_syn_containedin = FALSE;
|
||||||
|
|
||||||
/* free the keywords */
|
/* free the keywords */
|
||||||
@@ -5519,8 +5562,7 @@ get_id_list(arg, keylen, list)
|
|||||||
failed = TRUE;
|
failed = TRUE;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
STRNCPY(name + 1, p, end - p);
|
vim_strncpy(name + 1, p, end - p);
|
||||||
name[end - p + 1] = NUL;
|
|
||||||
if ( STRCMP(name + 1, "ALLBUT") == 0
|
if ( STRCMP(name + 1, "ALLBUT") == 0
|
||||||
|| STRCMP(name + 1, "ALL") == 0
|
|| STRCMP(name + 1, "ALL") == 0
|
||||||
|| STRCMP(name + 1, "TOP") == 0
|
|| STRCMP(name + 1, "TOP") == 0
|
||||||
@@ -5806,6 +5848,7 @@ static struct subcommand subcommands[] =
|
|||||||
{"off", syn_cmd_off},
|
{"off", syn_cmd_off},
|
||||||
{"region", syn_cmd_region},
|
{"region", syn_cmd_region},
|
||||||
{"reset", syn_cmd_reset},
|
{"reset", syn_cmd_reset},
|
||||||
|
{"spell", syn_cmd_spell},
|
||||||
{"sync", syn_cmd_sync},
|
{"sync", syn_cmd_sync},
|
||||||
{"", syn_cmd_list},
|
{"", syn_cmd_list},
|
||||||
{NULL, NULL}
|
{NULL, NULL}
|
||||||
@@ -8131,8 +8174,7 @@ syn_name2id(name)
|
|||||||
/* Avoid using stricmp() too much, it's slow on some systems */
|
/* Avoid using stricmp() too much, it's slow on some systems */
|
||||||
/* Avoid alloc()/free(), these are slow too. ID names over 200 chars
|
/* Avoid alloc()/free(), these are slow too. ID names over 200 chars
|
||||||
* don't deserve to be found! */
|
* don't deserve to be found! */
|
||||||
STRNCPY(name_u, name, 199);
|
vim_strncpy(name_u, name, 199);
|
||||||
name_u[199] = NUL;
|
|
||||||
vim_strup(name_u);
|
vim_strup(name_u);
|
||||||
for (i = highlight_ga.ga_len; --i >= 0; )
|
for (i = highlight_ga.ga_len; --i >= 0; )
|
||||||
if (HL_TABLE()[i].sg_name_u != NULL
|
if (HL_TABLE()[i].sg_name_u != NULL
|
||||||
|
|||||||
@@ -29,6 +29,8 @@ STARTTEST
|
|||||||
:%s/ctermbg=\d*/ctermbg=3/
|
:%s/ctermbg=\d*/ctermbg=3/
|
||||||
:" filter out possibly translated error message
|
:" filter out possibly translated error message
|
||||||
:%s/E475: [^:]*:/E475:/
|
:%s/E475: [^:]*:/E475:/
|
||||||
|
:" fix the fileformat
|
||||||
|
:set ff&
|
||||||
:wq!
|
:wq!
|
||||||
ENDTEST
|
ENDTEST
|
||||||
|
|
||||||
|
|||||||
@@ -7,9 +7,9 @@ STARTTEST
|
|||||||
:set enc=latin1
|
:set enc=latin1
|
||||||
:e!
|
:e!
|
||||||
:" First generate a .spl file from a .dic and a .aff file.
|
:" First generate a .spl file from a .dic and a .aff file.
|
||||||
gg:/^affstart1/+1,/^affend1/-1w Xtest.aff
|
gg:/^affstart1/+1,/^affend1/-1w! Xtest.aff
|
||||||
gg:/^dicstart/+1,/^dicend/-1w Xtest.dic
|
gg:/^dicstart/+1,/^dicend/-1w! Xtest.dic
|
||||||
:mkspell Xtest Xtest
|
:mkspell! Xtest Xtest
|
||||||
:"
|
:"
|
||||||
:" use that spell file
|
:" use that spell file
|
||||||
:set spl=Xtest.latin1.spl
|
:set spl=Xtest.latin1.spl
|
||||||
@@ -71,30 +71,29 @@ gg:/^affstart2/+1,/^affend2/-1w! Xtest.aff
|
|||||||
:" also use an addition file
|
:" also use an addition file
|
||||||
gg:/^addstart/+1,/^addend/-1w! Xtest.latin1.add
|
gg:/^addstart/+1,/^addend/-1w! Xtest.latin1.add
|
||||||
:mkspell! Xtest.latin1.add.spl Xtest.latin1.add
|
:mkspell! Xtest.latin1.add.spl Xtest.latin1.add
|
||||||
:set spl=en
|
|
||||||
:set spellfile=Xtest.latin1.add
|
:set spellfile=Xtest.latin1.add
|
||||||
/^test2:
|
/^test2:
|
||||||
]s:let str = spellbadword()
|
]s:let str = spellbadword()
|
||||||
:$put =str
|
:$put =str
|
||||||
:set spl=en_us
|
:set spl=Xtest_us.latin1.spl
|
||||||
/^test2:
|
/^test2:
|
||||||
]smm:let str = spellbadword()
|
]smm:let str = spellbadword()
|
||||||
:$put =str
|
:$put =str
|
||||||
`m]s:let str = spellbadword()
|
`m]s:let str = spellbadword()
|
||||||
:$put =str
|
:$put =str
|
||||||
:set spl=en_gb
|
:set spl=Xtest_gb.latin1.spl
|
||||||
/^test2:
|
/^test2:
|
||||||
]smm:let str = spellbadword()
|
]smm:let str = spellbadword()
|
||||||
:$put =str
|
:$put =str
|
||||||
`m]s:let str = spellbadword()
|
`m]s:let str = spellbadword()
|
||||||
:$put =str
|
:$put =str
|
||||||
:set spl=en_nz
|
:set spl=Xtest_nz.latin1.spl
|
||||||
/^test2:
|
/^test2:
|
||||||
]smm:let str = spellbadword()
|
]smm:let str = spellbadword()
|
||||||
:$put =str
|
:$put =str
|
||||||
`m]s:let str = spellbadword()
|
`m]s:let str = spellbadword()
|
||||||
:$put =str
|
:$put =str
|
||||||
:set spl=en_ca
|
:set spl=Xtest_ca.latin1.spl
|
||||||
/^test2:
|
/^test2:
|
||||||
]smm:let str = spellbadword()
|
]smm:let str = spellbadword()
|
||||||
:$put =str
|
:$put =str
|
||||||
|
|||||||
@@ -1159,11 +1159,9 @@ do_intro_line(row, mesg, add_version, attr)
|
|||||||
|
|
||||||
if (*mesg == ' ')
|
if (*mesg == ' ')
|
||||||
{
|
{
|
||||||
STRNCPY(modby, _("Modified by "), MODBY_LEN);
|
vim_strncpy(modby, _("Modified by "), MODBY_LEN - 1);
|
||||||
modby[MODBY_LEN - 1] = NUL;
|
|
||||||
l = STRLEN(modby);
|
l = STRLEN(modby);
|
||||||
STRNCPY(modby + l, MODIFIED_BY, MODBY_LEN - l);
|
vim_strncpy(modby + l, MODIFIED_BY, MODBY_LEN - l - 1);
|
||||||
modby[MODBY_LEN - 1] = NUL;
|
|
||||||
mesg = modby;
|
mesg = modby;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -36,5 +36,5 @@
|
|||||||
#define VIM_VERSION_NODOT "vim70aa"
|
#define VIM_VERSION_NODOT "vim70aa"
|
||||||
#define VIM_VERSION_SHORT "7.0aa"
|
#define VIM_VERSION_SHORT "7.0aa"
|
||||||
#define VIM_VERSION_MEDIUM "7.0aa ALPHA"
|
#define VIM_VERSION_MEDIUM "7.0aa ALPHA"
|
||||||
#define VIM_VERSION_LONG "VIM - Vi IMproved 7.0aa ALPHA (2005 Jul 12)"
|
#define VIM_VERSION_LONG "VIM - Vi IMproved 7.0aa ALPHA (2005 Jul 18)"
|
||||||
#define VIM_VERSION_LONG_DATE "VIM - Vi IMproved 7.0aa ALPHA (2005 Jul 12, compiled "
|
#define VIM_VERSION_LONG_DATE "VIM - Vi IMproved 7.0aa ALPHA (2005 Jul 18, compiled "
|
||||||
|
|||||||
Reference in New Issue
Block a user