mirror of
https://github.com/vim/vim.git
synced 2025-07-25 10:54:51 -04:00
updated for version 7.0081
This commit is contained in:
parent
cfc6c43ce2
commit
45eeb13324
@ -1,4 +1,4 @@
|
||||
*options.txt* For Vim version 7.0aa. Last change: 2005 May 31
|
||||
*options.txt* For Vim version 7.0aa. Last change: 2005 Jun 06
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@ -4294,7 +4294,6 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
h all previous modes when editing a help file
|
||||
a all previous modes
|
||||
r for |hit-enter| and |more-prompt| prompt
|
||||
A auto-select in Visual mode
|
||||
Normally you would enable the mouse in all four modes with: >
|
||||
:set mouse=a
|
||||
< When the mouse is not enabled, the GUI will still use the mouse for
|
||||
|
@ -1,4 +1,4 @@
|
||||
*spell.txt* For Vim version 7.0aa. Last change: 2005 Jun 04
|
||||
*spell.txt* For Vim version 7.0aa. Last change: 2005 Jun 06
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@ -160,6 +160,9 @@ find them here:
|
||||
into one en.spl file.
|
||||
Up to eight regions can be combined. *E754* *755*
|
||||
|
||||
When the spell file was written all currently used
|
||||
spell files will be reloaded.
|
||||
|
||||
Since you might want to change the word list for use with Vim the following
|
||||
procedure is recommended:
|
||||
|
||||
@ -205,10 +208,14 @@ The words must appear one per line. That is all that is required. Optional
|
||||
items are:
|
||||
- Empty and blank lines are ignored.
|
||||
- Lines starting with a # are ignored (comment lines).
|
||||
- A line starting with "=encoding=" before any word. After the second '='
|
||||
comes an encoding name. This tells Vim to setup conversion from the
|
||||
specified encoding to 'encoding'.
|
||||
- Other lines starting with '=' are special. The ones that are not recognized
|
||||
- A line starting with "/encoding=", before any word, specifies the encoding
|
||||
of the file. After the second '=' comes an encoding name. This tells Vim
|
||||
to setup conversion from the specified encoding to 'encoding'.
|
||||
- A line starting with "/?" specifies a word that should be marked as rare.
|
||||
- A line starting with "/!" specifies a word that should be marked as bad.
|
||||
- A line starting with "/=" specifies a word where case must match exactly.
|
||||
A "?" or "!" may be following: "/=?" and "/=!".
|
||||
- Other lines starting with '/' are special. The ones that are not recognized
|
||||
are ignored (but you do get a warning message).
|
||||
|
||||
|
||||
@ -273,6 +280,9 @@ The same word with all upper-case characters will always be OK.
|
||||
ALS ALS als Als ALs AlS aLs aLS
|
||||
AlS AlS ALS als Als ALs aLs aLS
|
||||
|
||||
The HUH affix ID can be used to specifically match a word in identical case
|
||||
only, see below.
|
||||
|
||||
Note in line 5 to 7 that non-word characters are used. You can include
|
||||
any character in a word. When checking the text a word still only matches
|
||||
when it appears with a non-word character before and after it. For Myspell a
|
||||
@ -282,9 +292,10 @@ After the word there is an optional slash and flags. Most of these flags are
|
||||
letters that indicate the affixes that can be used with this word.
|
||||
|
||||
*spell-affix-vim*
|
||||
A flag that Vim adds and is not in Myspell is the "=" flag. This has the
|
||||
meaning that case matters. This can be used if the word does not have the
|
||||
first letter in upper case at the start of a sentence. Example:
|
||||
A flag that Vim adds and is not in Myspell is the flag defined with HUH in the
|
||||
affix file. This has the meaning that case matters. This can be used if the
|
||||
word does not have the first letter in upper case at the start of a sentence.
|
||||
Example:
|
||||
|
||||
word list matches does not match ~
|
||||
's morgens/= 's morgens 'S morgens 's Morgens
|
||||
@ -311,9 +322,9 @@ example when using "cp1250" on Unix.
|
||||
*E761* *E762*
|
||||
Three lines in the affix file are needed. Simplistic example:
|
||||
|
||||
FOL áëñáëñ
|
||||
LOW áëñáëñ
|
||||
UPP áëñÁËÑ
|
||||
FOL áëñáëñ ~
|
||||
LOW áëñáëñ ~
|
||||
UPP áëñÁËÑ ~
|
||||
|
||||
All three lines must have exactly the same number of characters.
|
||||
|
||||
@ -338,4 +349,22 @@ generated with the "-ascii" argument will not contain the table with
|
||||
characters, so that it can be combine with spell files for any encoding.
|
||||
|
||||
|
||||
In the affix file a HUH line can be used to define the affix name used for
|
||||
keep-case words. Example:
|
||||
|
||||
HUH = ~
|
||||
|
||||
See above for an example |spell-affix-vim|.
|
||||
|
||||
|
||||
In the affix file a RAR line can be used to define the affix name used for
|
||||
rare words. Example:
|
||||
|
||||
RAR ? ~
|
||||
|
||||
Rare words are highlighted differently from bad words. This is to be used for
|
||||
words that are correct for the language, but are hardly ever used and could be
|
||||
a typing mistake anyway.
|
||||
|
||||
|
||||
vim:tw=78:sw=4:ts=8:ft=help:norl:
|
||||
|
@ -1,4 +1,4 @@
|
||||
*term.txt* For Vim version 7.0aa. Last change: 2005 Mar 14
|
||||
*term.txt* For Vim version 7.0aa. Last change: 2005 Jun 06
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@ -594,7 +594,6 @@ be used by Vim:
|
||||
h all previous modes when in a help file
|
||||
a all previous modes
|
||||
r for |hit-enter| prompt
|
||||
A auto-select in Visual mode
|
||||
|
||||
The default for 'mouse' is empty, the mouse is not used. Normally you would
|
||||
do: >
|
||||
|
@ -1,4 +1,4 @@
|
||||
*todo.txt* For Vim version 7.0aa. Last change: 2005 Jun 05
|
||||
*todo.txt* For Vim version 7.0aa. Last change: 2005 Jun 06
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@ -99,12 +99,16 @@ PLANNED FOR VERSION 7.0:
|
||||
Use array with flags, indicating if there is a word starting with this
|
||||
byte. Quickly skip bytes where no word can start.
|
||||
- Spell checking code todo's:
|
||||
- Implement user and project word lists. Commands to add words and to
|
||||
mark words as wrong.
|
||||
- Also allow replacing a word list. Need some mechanism to tell
|
||||
wether a spell file adds or replaces one found later in
|
||||
'runtimepath'.
|
||||
- Implement = flag in .dic: KEEPCASE for lower case word.
|
||||
- Is "-" to be considered a word character? "last-minute".
|
||||
No, in Dutch it can be added optionally. Then make English
|
||||
dictionaries consistent.
|
||||
- Implement user and project word lists. Commands to add words and to
|
||||
mark words as wrong.
|
||||
- In .aff use RAR to define affix name for rare word.
|
||||
- In .aff use HUH to define affix name for keep-case word.
|
||||
's morgens/= does not match 'S morgens
|
||||
- Implement compound words?
|
||||
- When @Spell and @NoSpell are both used only do spell checking for
|
||||
@ -413,8 +417,6 @@ quote. (Nieko Maatjes, 2005 Jan 4)
|
||||
|
||||
|
||||
Vi incompatibility:
|
||||
9 In Ex mode, "u" undoes all changes, not just the last one. (John Cowan)
|
||||
8 In Ex mode, an empty file doesn't have a first line, "1p" should fail.
|
||||
8 With undo/redo only marks in the changed lines should be changed. Other
|
||||
marks should be kept. Vi keeps each mark at the same text, even when it
|
||||
is deleted or restored. (Webb)
|
||||
|
@ -1,4 +1,4 @@
|
||||
*version7.txt* For Vim version 7.0aa. Last change: 2005 Jun 05
|
||||
*version7.txt* For Vim version 7.0aa. Last change: 2005 Jun 06
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@ -255,7 +255,8 @@ Items that were fixed for both Vi and POSIX compatibilty:
|
||||
- Autoindent for ":change" is using the first changed line.
|
||||
- Editing Ex command lines is not done in cooked mode, because CTRL-D and
|
||||
CTRL-T cannot be handled then.
|
||||
- In Ex mode, "1,3" prints three lines.
|
||||
- In Ex mode, "1,3" prints three lines. "%" prints all lines.
|
||||
- In Ex mode "undo" would undo all changes since Ex mode was started.
|
||||
- Implemented the 'prompt' option.
|
||||
|
||||
|
||||
|
Binary file not shown.
Binary file not shown.
@ -2,7 +2,7 @@
|
||||
"
|
||||
" Language: Logtalk
|
||||
" Maintainer: Paulo Moura <pmoura@logtalk.org>
|
||||
" Last Change: May 30, 2005
|
||||
" Last Change: June 6, 2005
|
||||
|
||||
|
||||
" Quit when a syntax file was already loaded:
|
||||
@ -48,23 +48,25 @@ syn region logtalkExtCall matchgroup=logtalkExtCallTag start="{" matchgroup=l
|
||||
|
||||
" Logtalk opening entity directives
|
||||
|
||||
syn region logtalkOpenEntityDir matchgroup=logtalkOpenEntityDirTag start=":- object(" matchgroup=logtalkOpenEntityDirTag end=")\." contains=ALL
|
||||
syn region logtalkOpenEntityDir matchgroup=logtalkOpenEntityDirTag start=":- protocol(" matchgroup=logtalkOpenEntityDirTag end=")\." contains=ALL
|
||||
syn region logtalkOpenEntityDir matchgroup=logtalkOpenEntityDirTag start=":- category(" matchgroup=logtalkOpenEntityDirTag end=")\." contains=ALL
|
||||
syn region logtalkOpenEntityDir matchgroup=logtalkOpenEntityDirTag start=":- object(" matchgroup=logtalkOpenEntityDirTag end=")\." contains=logtalkEntity,logtalkVariable,logtalkNumber,logtalkOperator,logtalkEntityRel
|
||||
syn region logtalkOpenEntityDir matchgroup=logtalkOpenEntityDirTag start=":- protocol(" matchgroup=logtalkOpenEntityDirTag end=")\." contains=logtalkEntity,logtalkVariable,logtalkNumber,logtalkOperator,logtalkEntityRel
|
||||
syn region logtalkOpenEntityDir matchgroup=logtalkOpenEntityDirTag start=":- category(" matchgroup=logtalkOpenEntityDirTag end=")\." contains=logtalkEntity,logtalkVariable,logtalkNumber,logtalkOperator,logtalkEntityRel
|
||||
|
||||
|
||||
" Logtalk closing entity directives
|
||||
|
||||
syn match logtalkCloseEntityDir ":- end_\(object\|protocol\|category\)\."
|
||||
syn match logtalkCloseEntityDir ":- end_object\."
|
||||
syn match logtalkCloseEntityDir ":- end_protocol\."
|
||||
syn match logtalkCloseEntityDir ":- end_category\."
|
||||
|
||||
|
||||
" Logtalk entity relations
|
||||
|
||||
syn region logtalkEntityRel matchgroup=logtalkEntityRelTag start="instantiates(" matchgroup=logtalkEntityRelTag end=")" contains=logtalkEntity contained
|
||||
syn region logtalkEntityRel matchgroup=logtalkEntityRelTag start="specializes(" matchgroup=logtalkEntityRelTag end=")" contains=logtalkEntity contained
|
||||
syn region logtalkEntityRel matchgroup=logtalkEntityRelTag start="extends(" matchgroup=logtalkEntityRelTag end=")" contains=logtalkEntity contained
|
||||
syn region logtalkEntityRel matchgroup=logtalkEntityRelTag start="imports(" matchgroup=logtalkEntityRelTag end=")" contains=logtalkEntity contained
|
||||
syn region logtalkEntityRel matchgroup=logtalkEntityRelTag start="implements(" matchgroup=logtalkEntityRelTag end=")" contains=logtalkEntity contained
|
||||
syn region logtalkEntityRel matchgroup=logtalkEntityRelTag start="instantiates(" matchgroup=logtalkEntityRelTag end=")" contains=logtalkEntity,logtalkVariable,logtalkNumber,logtalkOperator contained
|
||||
syn region logtalkEntityRel matchgroup=logtalkEntityRelTag start="specializes(" matchgroup=logtalkEntityRelTag end=")" contains=logtalkEntity,logtalkVariable,logtalkNumber,logtalkOperator contained
|
||||
syn region logtalkEntityRel matchgroup=logtalkEntityRelTag start="extends(" matchgroup=logtalkEntityRelTag end=")" contains=logtalkEntity,logtalkVariable,logtalkNumber,logtalkOperator contained
|
||||
syn region logtalkEntityRel matchgroup=logtalkEntityRelTag start="imports(" matchgroup=logtalkEntityRelTag end=")" contains=logtalkEntity,logtalkVariable,logtalkNumber,logtalkOperator contained
|
||||
syn region logtalkEntityRel matchgroup=logtalkEntityRelTag start="implements(" matchgroup=logtalkEntityRelTag end=")" contains=logtalkEntity,logtalkVariable,logtalkNumber,logtalkOperator contained
|
||||
|
||||
|
||||
" Logtalk directives
|
||||
@ -297,9 +299,9 @@ syn match logtalkNumber "\<\d\+\>"
|
||||
syn match logtalkNumber "\<\d\+\.\d\+\>"
|
||||
syn match logtalkNumber "\<\d\+[eE][-+]\=\d\+\>"
|
||||
syn match logtalkNumber "\<\d\+\.\d\+[eE][-+]\=\d\+\>"
|
||||
syn match logtalkNumber "\<0'[0-9a-zA-Z]\>"
|
||||
syn match logtalkNumber "\<0'.\>"
|
||||
syn match logtalkNumber "\<0b[0-1]\+\>"
|
||||
syn match logtalkNumber "\<0o[0-7]\+\>"
|
||||
syn match logtalkNumber "\<0o\o\+\>"
|
||||
syn match logtalkNumber "\<0x\x\+\>"
|
||||
|
||||
|
||||
@ -310,10 +312,17 @@ syn match logtalkOperator "\."
|
||||
|
||||
" Logtalk comments
|
||||
|
||||
syn region logtalkBlockComment start="/\*" end="\*/"
|
||||
syn region logtalkBlockComment start="/\*" end="\*/" fold
|
||||
syn match logtalkLineComment "%.*"
|
||||
|
||||
|
||||
" Logtalk entity folding
|
||||
|
||||
syn region logtalkEntity transparent fold keepend start=":- object(" end=":- end_object\." contains=ALL
|
||||
syn region logtalkEntity transparent fold keepend start=":- protocol(" end=":- end_protocol\." contains=ALL
|
||||
syn region logtalkEntity transparent fold keepend start=":- category(" end=":- end_category\." contains=ALL
|
||||
|
||||
|
||||
syn sync ccomment logtalkBlockComment maxlines=50
|
||||
|
||||
|
||||
@ -370,3 +379,5 @@ endif
|
||||
let b:current_syntax = "logtalk"
|
||||
|
||||
setlocal ts=4
|
||||
setlocal fdm=syntax
|
||||
setlocal fdc=2
|
||||
|
376
src/charset.c
376
src/charset.c
@ -914,382 +914,6 @@ vim_iswordc_buf(p, buf)
|
||||
# endif
|
||||
return (GET_CHARTAB(buf, *p) != 0);
|
||||
}
|
||||
|
||||
/*
|
||||
* The tables used for spelling. These are only used for the first 256
|
||||
* characters.
|
||||
*/
|
||||
typedef struct spelltab_S
|
||||
{
|
||||
char_u st_isw[256]; /* flags: is word char */
|
||||
char_u st_isu[256]; /* flags: is uppercase char */
|
||||
char_u st_fold[256]; /* chars: folded case */
|
||||
} spelltab_T;
|
||||
|
||||
static spelltab_T spelltab;
|
||||
static int did_set_spelltab;
|
||||
|
||||
#define SPELL_ISWORD 1
|
||||
#define SPELL_ISUPPER 2
|
||||
|
||||
static void clear_spell_chartab __ARGS((spelltab_T *sp));
|
||||
static int set_spell_finish __ARGS((spelltab_T *new_st));
|
||||
|
||||
/*
|
||||
* Init the chartab used for spelling for ASCII.
|
||||
* EBCDIC is not supported!
|
||||
*/
|
||||
static void
|
||||
clear_spell_chartab(sp)
|
||||
spelltab_T *sp;
|
||||
{
|
||||
int i;
|
||||
|
||||
/* Init everything to FALSE. */
|
||||
vim_memset(sp->st_isw, FALSE, sizeof(sp->st_isw));
|
||||
vim_memset(sp->st_isu, FALSE, sizeof(sp->st_isu));
|
||||
for (i = 0; i < 256; ++i)
|
||||
sp->st_fold[i] = i;
|
||||
|
||||
/* We include digits. A word shouldn't start with a digit, but handling
|
||||
* that is done separately. */
|
||||
for (i = '0'; i <= '9'; ++i)
|
||||
sp->st_isw[i] = TRUE;
|
||||
for (i = 'A'; i <= 'Z'; ++i)
|
||||
{
|
||||
sp->st_isw[i] = TRUE;
|
||||
sp->st_isu[i] = TRUE;
|
||||
sp->st_fold[i] = i + 0x20;
|
||||
}
|
||||
for (i = 'a'; i <= 'z'; ++i)
|
||||
sp->st_isw[i] = TRUE;
|
||||
}
|
||||
|
||||
/*
|
||||
* Init the chartab used for spelling. Only depends on 'encoding'.
|
||||
* Called once while starting up and when 'encoding' changes.
|
||||
* The default is to use isalpha(), but the spell file should define the word
|
||||
* characters to make it possible that 'encoding' differs from the current
|
||||
* locale.
|
||||
*/
|
||||
void
|
||||
init_spell_chartab()
|
||||
{
|
||||
int i;
|
||||
|
||||
did_set_spelltab = FALSE;
|
||||
clear_spell_chartab(&spelltab);
|
||||
|
||||
#ifdef FEAT_MBYTE
|
||||
if (enc_dbcs)
|
||||
{
|
||||
/* DBCS: assume double-wide characters are word characters. */
|
||||
for (i = 128; i <= 255; ++i)
|
||||
if (MB_BYTE2LEN(i) == 2)
|
||||
spelltab.st_isw[i] = TRUE;
|
||||
}
|
||||
else
|
||||
#endif
|
||||
{
|
||||
/* Rough guess: use isalpha() and isupper() for characters above 128.
|
||||
* */
|
||||
for (i = 128; i < 256; ++i)
|
||||
{
|
||||
spelltab.st_isw[i] = MB_ISUPPER(i) || MB_ISLOWER(i);
|
||||
if (MB_ISUPPER(i))
|
||||
{
|
||||
spelltab.st_isu[i] = TRUE;
|
||||
spelltab.st_fold[i] = MB_TOLOWER(i);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#if defined(FEAT_MBYTE) || defined(PROTO)
|
||||
static char *e_affform = N_("E761: Format error in affix file FOL, LOW or UPP");
|
||||
static char *e_affrange = N_("E762: Character in FOL, LOW or UPP is out of range");
|
||||
|
||||
/*
|
||||
* Set the spell character tables from strings in the affix file.
|
||||
*/
|
||||
int
|
||||
set_spell_chartab(fol, low, upp)
|
||||
char_u *fol;
|
||||
char_u *low;
|
||||
char_u *upp;
|
||||
{
|
||||
/* We build the new tables here first, so that we can compare with the
|
||||
* previous one. */
|
||||
spelltab_T new_st;
|
||||
char_u *pf = fol, *pl = low, *pu = upp;
|
||||
int f, l, u;
|
||||
|
||||
clear_spell_chartab(&new_st);
|
||||
|
||||
while (*pf != NUL)
|
||||
{
|
||||
if (*pl == NUL || *pu == NUL)
|
||||
{
|
||||
EMSG(_(e_affform));
|
||||
return FAIL;
|
||||
}
|
||||
#ifdef FEAT_MBYTE
|
||||
f = mb_ptr2char_adv(&pf);
|
||||
l = mb_ptr2char_adv(&pl);
|
||||
u = mb_ptr2char_adv(&pu);
|
||||
#else
|
||||
f = *pf++;
|
||||
l = *pl++;
|
||||
u = *pu++;
|
||||
#endif
|
||||
/* Every character that appears is a word character. */
|
||||
if (f < 256)
|
||||
new_st.st_isw[f] = TRUE;
|
||||
if (l < 256)
|
||||
new_st.st_isw[l] = TRUE;
|
||||
if (u < 256)
|
||||
new_st.st_isw[u] = TRUE;
|
||||
|
||||
/* if "LOW" and "FOL" are not the same the "LOW" char needs
|
||||
* case-folding */
|
||||
if (l < 256 && l != f)
|
||||
{
|
||||
if (f >= 256)
|
||||
{
|
||||
EMSG(_(e_affrange));
|
||||
return FAIL;
|
||||
}
|
||||
new_st.st_fold[l] = f;
|
||||
}
|
||||
|
||||
/* if "UPP" and "FOL" are not the same the "UPP" char needs
|
||||
* case-folding and it's upper case. */
|
||||
if (u < 256 && u != f)
|
||||
{
|
||||
if (f >= 256)
|
||||
{
|
||||
EMSG(_(e_affrange));
|
||||
return FAIL;
|
||||
}
|
||||
new_st.st_fold[u] = f;
|
||||
new_st.st_isu[u] = TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
if (*pl != NUL || *pu != NUL)
|
||||
{
|
||||
EMSG(_(e_affform));
|
||||
return FAIL;
|
||||
}
|
||||
|
||||
return set_spell_finish(&new_st);
|
||||
}
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Set the spell character tables from strings in the .spl file.
|
||||
*/
|
||||
int
|
||||
set_spell_charflags(flags, cnt, upp)
|
||||
char_u *flags;
|
||||
int cnt;
|
||||
char_u *upp;
|
||||
{
|
||||
/* We build the new tables here first, so that we can compare with the
|
||||
* previous one. */
|
||||
spelltab_T new_st;
|
||||
int i;
|
||||
char_u *p = upp;
|
||||
|
||||
clear_spell_chartab(&new_st);
|
||||
|
||||
for (i = 0; i < cnt; ++i)
|
||||
{
|
||||
new_st.st_isw[i + 128] = (flags[i] & SPELL_ISWORD) != 0;
|
||||
new_st.st_isu[i + 128] = (flags[i] & SPELL_ISUPPER) != 0;
|
||||
|
||||
if (*p == NUL)
|
||||
return FAIL;
|
||||
#ifdef FEAT_MBYTE
|
||||
new_st.st_fold[i + 128] = mb_ptr2char_adv(&p);
|
||||
#else
|
||||
new_st.st_fold[i + 128] = *p++;
|
||||
#endif
|
||||
}
|
||||
|
||||
return set_spell_finish(&new_st);
|
||||
}
|
||||
|
||||
static int
|
||||
set_spell_finish(new_st)
|
||||
spelltab_T *new_st;
|
||||
{
|
||||
int i;
|
||||
|
||||
if (did_set_spelltab)
|
||||
{
|
||||
/* check that it's the same table */
|
||||
for (i = 0; i < 256; ++i)
|
||||
{
|
||||
if (spelltab.st_isw[i] != new_st->st_isw[i]
|
||||
|| spelltab.st_isu[i] != new_st->st_isu[i]
|
||||
|| spelltab.st_fold[i] != new_st->st_fold[i])
|
||||
{
|
||||
EMSG(_("E763: Word characters differ between spell files"));
|
||||
return FAIL;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
/* copy the new spelltab into the one being used */
|
||||
spelltab = *new_st;
|
||||
did_set_spelltab = TRUE;
|
||||
}
|
||||
|
||||
return OK;
|
||||
}
|
||||
|
||||
#if defined(FEAT_MBYTE) || defined(PROTO)
|
||||
/*
|
||||
* Write the current tables into the .spl file.
|
||||
* This makes sure the same characters are recognized as word characters when
|
||||
* generating an when using a spell file.
|
||||
*/
|
||||
void
|
||||
write_spell_chartab(fd)
|
||||
FILE *fd;
|
||||
{
|
||||
char_u charbuf[256 * 4];
|
||||
int len = 0;
|
||||
int flags;
|
||||
int i;
|
||||
|
||||
fputc(128, fd); /* <charflagslen> */
|
||||
for (i = 128; i < 256; ++i)
|
||||
{
|
||||
flags = 0;
|
||||
if (spelltab.st_isw[i])
|
||||
flags |= SPELL_ISWORD;
|
||||
if (spelltab.st_isu[i])
|
||||
flags |= SPELL_ISUPPER;
|
||||
fputc(flags, fd); /* <charflags> */
|
||||
|
||||
len += mb_char2bytes(spelltab.st_fold[i], charbuf + len);
|
||||
}
|
||||
|
||||
put_bytes(fd, (long_u)len, 2); /* <fcharlen> */
|
||||
fwrite(charbuf, (size_t)len, (size_t)1, fd); /* <fchars> */
|
||||
}
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Return TRUE if "p" points to a word character for spelling.
|
||||
*/
|
||||
int
|
||||
spell_iswordc(p)
|
||||
char_u *p;
|
||||
{
|
||||
# ifdef FEAT_MBYTE
|
||||
if (has_mbyte && MB_BYTE2LEN(*p) > 1)
|
||||
return mb_get_class(p) >= 2;
|
||||
# endif
|
||||
return spelltab.st_isw[*p];
|
||||
}
|
||||
|
||||
/*
|
||||
* Return TRUE if "c" is an upper-case character for spelling.
|
||||
*/
|
||||
int
|
||||
spell_isupper(c)
|
||||
int c;
|
||||
{
|
||||
# ifdef FEAT_MBYTE
|
||||
if (enc_utf8)
|
||||
{
|
||||
/* For Unicode we can call utf_isupper(), but don't do that for ASCII,
|
||||
* because we don't want to use 'casemap' here. */
|
||||
if (c >= 128)
|
||||
return utf_isupper(c);
|
||||
}
|
||||
else if (has_mbyte && c > 256)
|
||||
{
|
||||
/* For characters above 255 we don't have something specfied.
|
||||
* Fall back to locale-dependent iswupper(). If not available
|
||||
* simply return FALSE. */
|
||||
# ifdef HAVE_ISWUPPER
|
||||
return iswupper(c);
|
||||
# else
|
||||
return FALSE;
|
||||
# endif
|
||||
}
|
||||
# endif
|
||||
return spelltab.st_isu[c];
|
||||
}
|
||||
|
||||
/*
|
||||
* case-fold "p[len]" into "buf[buflen]". Used for spell checking.
|
||||
* Returns FAIL when something wrong.
|
||||
*/
|
||||
int
|
||||
spell_casefold(p, len, buf, buflen)
|
||||
char_u *p;
|
||||
int len;
|
||||
char_u *buf;
|
||||
int buflen;
|
||||
{
|
||||
int i;
|
||||
|
||||
if (len >= buflen)
|
||||
{
|
||||
buf[0] = NUL;
|
||||
return FAIL; /* result will not fit */
|
||||
}
|
||||
|
||||
#ifdef FEAT_MBYTE
|
||||
if (has_mbyte)
|
||||
{
|
||||
int c;
|
||||
int outi = 0;
|
||||
|
||||
/* Fold one character at a time. */
|
||||
for (i = 0; i < len; i += mb_ptr2len_check(p + i))
|
||||
{
|
||||
c = mb_ptr2char(p + i);
|
||||
if (enc_utf8)
|
||||
/* For Unicode case folding is always the same, no need to use
|
||||
* the table from the spell file. */
|
||||
c = utf_fold(c);
|
||||
else if (c < 256)
|
||||
/* Use the table from the spell file. */
|
||||
c = spelltab.st_fold[c];
|
||||
# ifdef HAVE_TOWLOWER
|
||||
else
|
||||
/* We don't know what to do, fall back to towlower(), it
|
||||
* depends on the current locale. */
|
||||
c = towlower(c);
|
||||
# endif
|
||||
if (outi + MB_MAXBYTES > buflen)
|
||||
{
|
||||
buf[outi] = NUL;
|
||||
return FAIL;
|
||||
}
|
||||
outi += mb_char2bytes(c, buf + outi);
|
||||
}
|
||||
buf[outi] = NUL;
|
||||
}
|
||||
else
|
||||
#endif
|
||||
{
|
||||
/* Be quick for non-multibyte encodings. */
|
||||
for (i = 0; i < len; ++i)
|
||||
buf[i] = spelltab.st_fold[p[i]];
|
||||
buf[i] = NUL;
|
||||
}
|
||||
|
||||
return OK;
|
||||
}
|
||||
|
||||
#endif /* FEAT_SYN_HL */
|
||||
|
||||
/*
|
||||
|
@ -4185,6 +4185,7 @@ gui_mch_get_color(name)
|
||||
{"brown", RGB(0x80, 0x40, 0x40)}, /*W*/
|
||||
{"yellow", RGB(0xFC, 0xF3, 0x05)}, /*M*/
|
||||
{"lightyellow", RGB(0xFF, 0xFF, 0xA0)}, /*M*/
|
||||
{"darkyellow", RGB(0xBB, 0xBB, 0x00)}, /*U*/
|
||||
{"SeaGreen", RGB(0x2E, 0x8B, 0x57)}, /*W 0x4E8975 */
|
||||
{"orange", RGB(0xFC, 0x80, 0x00)}, /*W 0xF87A17 */
|
||||
{"Purple", RGB(0xA0, 0x20, 0xF0)}, /*W 0x8e35e5 */
|
||||
|
@ -2192,6 +2192,7 @@ mb_strnicmp(s1, s2, nn)
|
||||
{
|
||||
int i, j, l;
|
||||
int cdiff;
|
||||
int incomplete = FALSE;
|
||||
int n = nn;
|
||||
|
||||
for (i = 0; i < n; i += l)
|
||||
@ -2202,7 +2203,10 @@ mb_strnicmp(s1, s2, nn)
|
||||
{
|
||||
l = utf_byte2len(s1[i]);
|
||||
if (l > n - i)
|
||||
{
|
||||
l = n - i; /* incomplete character */
|
||||
incomplete = TRUE;
|
||||
}
|
||||
/* Check directly first, it's faster. */
|
||||
for (j = 0; j < l; ++j)
|
||||
if (s1[i + j] != s2[i + j])
|
||||
@ -2210,7 +2214,7 @@ mb_strnicmp(s1, s2, nn)
|
||||
if (j < l)
|
||||
{
|
||||
/* If one of the two characters is incomplete return -1. */
|
||||
if (i + utf_byte2len(s1[i]) > n || i + utf_byte2len(s2[i]) > n)
|
||||
if (incomplete || i + utf_byte2len(s2[i]) > n)
|
||||
return -1;
|
||||
cdiff = utf_fold(utf_ptr2char(s1 + i))
|
||||
- utf_fold(utf_ptr2char(s2 + i));
|
||||
|
@ -5,4 +5,5 @@ char_u *did_set_spelllang __ARGS((buf_T *buf));
|
||||
void spell_reload __ARGS((void));
|
||||
void put_bytes __ARGS((FILE *fd, long_u nr, int len));
|
||||
void ex_mkspell __ARGS((exarg_T *eap));
|
||||
void init_spell_chartab __ARGS((void));
|
||||
/* vim: set ft=c : */
|
||||
|
17
src/regexp.c
17
src/regexp.c
@ -322,9 +322,9 @@ toggle_Magic(x)
|
||||
|
||||
/* Used for an error (down from) vim_regcomp(): give the error message, set
|
||||
* rc_did_emsg and return NULL */
|
||||
#define EMSG_RET_NULL(m) { EMSG(m); rc_did_emsg = TRUE; return NULL; }
|
||||
#define EMSG_M_RET_NULL(m, c) { EMSG2(m, c ? "" : "\\"); rc_did_emsg = TRUE; return NULL; }
|
||||
#define EMSG_RET_FAIL(m) { EMSG(m); rc_did_emsg = TRUE; return FAIL; }
|
||||
#define EMSG_RET_NULL(m) return (EMSG(m), rc_did_emsg = TRUE, NULL)
|
||||
#define EMSG_M_RET_NULL(m, c) return (EMSG2((m), (c) ? "" : "\\"), rc_did_emsg = TRUE, NULL)
|
||||
#define EMSG_RET_FAIL(m) return (EMSG(m), rc_did_emsg = TRUE, FAIL)
|
||||
#define EMSG_ONE_RET_NULL EMSG_M_RET_NULL(_("E369: invalid item in %s%%[]"), reg_magic == MAGIC_ALL)
|
||||
|
||||
#define MAX_LIMIT (32767L << 16L)
|
||||
@ -1246,20 +1246,20 @@ reg(paren, flagp)
|
||||
{
|
||||
#ifdef FEAT_SYN_HL
|
||||
if (paren == REG_ZPAREN)
|
||||
EMSG_RET_NULL(_("E52: Unmatched \\z("))
|
||||
EMSG_RET_NULL(_("E52: Unmatched \\z("));
|
||||
else
|
||||
#endif
|
||||
if (paren == REG_NPAREN)
|
||||
EMSG_M_RET_NULL(_("E53: Unmatched %s%%("), reg_magic == MAGIC_ALL)
|
||||
EMSG_M_RET_NULL(_("E53: Unmatched %s%%("), reg_magic == MAGIC_ALL);
|
||||
else
|
||||
EMSG_M_RET_NULL(_("E54: Unmatched %s("), reg_magic == MAGIC_ALL)
|
||||
EMSG_M_RET_NULL(_("E54: Unmatched %s("), reg_magic == MAGIC_ALL);
|
||||
}
|
||||
else if (paren == REG_NOPAREN && peekchr() != NUL)
|
||||
{
|
||||
if (curchr == Magic(')'))
|
||||
EMSG_M_RET_NULL(_("E55: Unmatched %s)"), reg_magic == MAGIC_ALL)
|
||||
EMSG_M_RET_NULL(_("E55: Unmatched %s)"), reg_magic == MAGIC_ALL);
|
||||
else
|
||||
EMSG_RET_NULL(_(e_trailing)) /* "Can't happen". */
|
||||
EMSG_RET_NULL(_(e_trailing)); /* "Can't happen". */
|
||||
/* NOTREACHED */
|
||||
}
|
||||
/*
|
||||
@ -2985,7 +2985,6 @@ typedef struct
|
||||
char_u *ptr;
|
||||
lpos_T pos;
|
||||
} se_u;
|
||||
int se_len;
|
||||
} save_se_T;
|
||||
|
||||
static char_u *reg_getline __ARGS((linenr_T lnum));
|
||||
|
@ -6028,7 +6028,7 @@ static char *(highlight_init_light[]) =
|
||||
"Folded term=standout ctermbg=Grey ctermfg=DarkBlue guibg=LightGrey guifg=DarkBlue",
|
||||
"FoldColumn term=standout ctermbg=Grey ctermfg=DarkBlue guibg=Grey guifg=DarkBlue",
|
||||
"SignColumn term=standout ctermbg=Grey ctermfg=DarkBlue guibg=Grey guifg=DarkBlue",
|
||||
"Visual term=reverse ctermbg=Grey guibg=Grey",
|
||||
"Visual term=reverse ctermbg=LightGrey guibg=LightGrey",
|
||||
"DiffAdd term=bold ctermbg=LightBlue guibg=LightBlue",
|
||||
"DiffChange term=bold ctermbg=LightMagenta guibg=LightMagenta",
|
||||
"DiffDelete term=bold ctermfg=Blue ctermbg=LightCyan gui=bold guifg=Blue guibg=LightCyan",
|
||||
@ -6053,7 +6053,7 @@ static char *(highlight_init_dark[]) =
|
||||
"Folded term=standout ctermbg=DarkGrey ctermfg=Cyan guibg=DarkGrey guifg=Cyan",
|
||||
"FoldColumn term=standout ctermbg=DarkGrey ctermfg=Cyan guibg=Grey guifg=Cyan",
|
||||
"SignColumn term=standout ctermbg=DarkGrey ctermfg=Cyan guibg=Grey guifg=Cyan",
|
||||
"Visual term=reverse ctermbg=Grey guibg=Grey",
|
||||
"Visual term=reverse ctermbg=DarkGrey guibg=DarkGrey",
|
||||
"DiffAdd term=bold ctermbg=DarkBlue guibg=DarkBlue",
|
||||
"DiffChange term=bold ctermbg=DarkMagenta guibg=DarkMagenta",
|
||||
"DiffDelete term=bold ctermfg=Blue ctermbg=DarkCyan gui=bold guifg=Blue guibg=DarkCyan",
|
||||
|
@ -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 (2005 Jun 5)"
|
||||
#define VIM_VERSION_LONG_DATE "VIM - Vi IMproved 7.0aa ALPHA (2005 Jun 5, compiled "
|
||||
#define VIM_VERSION_LONG "VIM - Vi IMproved 7.0aa ALPHA (2005 Jun 6)"
|
||||
#define VIM_VERSION_LONG_DATE "VIM - Vi IMproved 7.0aa ALPHA (2005 Jun 6, compiled "
|
||||
|
Loading…
x
Reference in New Issue
Block a user