Mirror of the Vim source from https://github.com/vim/vim
Revision | 74e9d19831c2357d7b998f484ebc609dbc08c5e4 (tree) |
---|---|
Zeit | 2005-06-07 06:59:07 |
Autor | vimboss |
Commiter | vimboss |
updated for version 7.0081
@@ -1,4 +1,4 @@ | ||
1 | -*options.txt* For Vim version 7.0aa. Last change: 2005 May 31 | |
1 | +*options.txt* For Vim version 7.0aa. Last change: 2005 Jun 06 | |
2 | 2 | |
3 | 3 | |
4 | 4 | VIM REFERENCE MANUAL by Bram Moolenaar |
@@ -4294,7 +4294,6 @@ | ||
4294 | 4294 | h all previous modes when editing a help file |
4295 | 4295 | a all previous modes |
4296 | 4296 | r for |hit-enter| and |more-prompt| prompt |
4297 | - A auto-select in Visual mode | |
4298 | 4297 | Normally you would enable the mouse in all four modes with: > |
4299 | 4298 | :set mouse=a |
4300 | 4299 | < When the mouse is not enabled, the GUI will still use the mouse for |
@@ -1,4 +1,4 @@ | ||
1 | -*spell.txt* For Vim version 7.0aa. Last change: 2005 Jun 04 | |
1 | +*spell.txt* For Vim version 7.0aa. Last change: 2005 Jun 06 | |
2 | 2 | |
3 | 3 | |
4 | 4 | VIM REFERENCE MANUAL by Bram Moolenaar |
@@ -160,6 +160,9 @@ | ||
160 | 160 | into one en.spl file. |
161 | 161 | Up to eight regions can be combined. *E754* *755* |
162 | 162 | |
163 | + When the spell file was written all currently used | |
164 | + spell files will be reloaded. | |
165 | + | |
163 | 166 | Since you might want to change the word list for use with Vim the following |
164 | 167 | procedure is recommended: |
165 | 168 |
@@ -205,10 +208,14 @@ | ||
205 | 208 | items are: |
206 | 209 | - Empty and blank lines are ignored. |
207 | 210 | - Lines starting with a # are ignored (comment lines). |
208 | -- A line starting with "=encoding=" before any word. After the second '=' | |
209 | - comes an encoding name. This tells Vim to setup conversion from the | |
210 | - specified encoding to 'encoding'. | |
211 | -- Other lines starting with '=' are special. The ones that are not recognized | |
211 | +- A line starting with "/encoding=", before any word, specifies the encoding | |
212 | + of the file. After the second '=' comes an encoding name. This tells Vim | |
213 | + to setup conversion from the specified encoding to 'encoding'. | |
214 | +- A line starting with "/?" specifies a word that should be marked as rare. | |
215 | +- A line starting with "/!" specifies a word that should be marked as bad. | |
216 | +- A line starting with "/=" specifies a word where case must match exactly. | |
217 | + A "?" or "!" may be following: "/=?" and "/=!". | |
218 | +- Other lines starting with '/' are special. The ones that are not recognized | |
212 | 219 | are ignored (but you do get a warning message). |
213 | 220 | |
214 | 221 |
@@ -273,6 +280,9 @@ | ||
273 | 280 | ALS ALS als Als ALs AlS aLs aLS |
274 | 281 | AlS AlS ALS als Als ALs aLs aLS |
275 | 282 | |
283 | +The HUH affix ID can be used to specifically match a word in identical case | |
284 | +only, see below. | |
285 | + | |
276 | 286 | Note in line 5 to 7 that non-word characters are used. You can include |
277 | 287 | any character in a word. When checking the text a word still only matches |
278 | 288 | when it appears with a non-word character before and after it. For Myspell a |
@@ -282,9 +292,10 @@ | ||
282 | 292 | letters that indicate the affixes that can be used with this word. |
283 | 293 | |
284 | 294 | *spell-affix-vim* |
285 | -A flag that Vim adds and is not in Myspell is the "=" flag. This has the | |
286 | -meaning that case matters. This can be used if the word does not have the | |
287 | -first letter in upper case at the start of a sentence. Example: | |
295 | +A flag that Vim adds and is not in Myspell is the flag defined with HUH in the | |
296 | +affix file. This has the meaning that case matters. This can be used if the | |
297 | +word does not have the first letter in upper case at the start of a sentence. | |
298 | +Example: | |
288 | 299 | |
289 | 300 | word list matches does not match ~ |
290 | 301 | 's morgens/= 's morgens 'S morgens 's Morgens |
@@ -311,9 +322,9 @@ | ||
311 | 322 | *E761* *E762* |
312 | 323 | Three lines in the affix file are needed. Simplistic example: |
313 | 324 | |
314 | - FOL áëñáëñ | |
315 | - LOW áëñáëñ | |
316 | - UPP áëñÁËÑ | |
325 | + FOL áëñáëñ ~ | |
326 | + LOW áëñáëñ ~ | |
327 | + UPP áëñÁËÑ ~ | |
317 | 328 | |
318 | 329 | All three lines must have exactly the same number of characters. |
319 | 330 |
@@ -338,4 +349,22 @@ | ||
338 | 349 | characters, so that it can be combine with spell files for any encoding. |
339 | 350 | |
340 | 351 | |
352 | +In the affix file a HUH line can be used to define the affix name used for | |
353 | +keep-case words. Example: | |
354 | + | |
355 | + HUH = ~ | |
356 | + | |
357 | +See above for an example |spell-affix-vim|. | |
358 | + | |
359 | + | |
360 | +In the affix file a RAR line can be used to define the affix name used for | |
361 | +rare words. Example: | |
362 | + | |
363 | + RAR ? ~ | |
364 | + | |
365 | +Rare words are highlighted differently from bad words. This is to be used for | |
366 | +words that are correct for the language, but are hardly ever used and could be | |
367 | +a typing mistake anyway. | |
368 | + | |
369 | + | |
341 | 370 | vim:tw=78:sw=4:ts=8:ft=help:norl: |
@@ -1,4 +1,4 @@ | ||
1 | -*term.txt* For Vim version 7.0aa. Last change: 2005 Mar 14 | |
1 | +*term.txt* For Vim version 7.0aa. Last change: 2005 Jun 06 | |
2 | 2 | |
3 | 3 | |
4 | 4 | VIM REFERENCE MANUAL by Bram Moolenaar |
@@ -594,7 +594,6 @@ | ||
594 | 594 | h all previous modes when in a help file |
595 | 595 | a all previous modes |
596 | 596 | r for |hit-enter| prompt |
597 | - A auto-select in Visual mode | |
598 | 597 | |
599 | 598 | The default for 'mouse' is empty, the mouse is not used. Normally you would |
600 | 599 | do: > |
@@ -1,4 +1,4 @@ | ||
1 | -*todo.txt* For Vim version 7.0aa. Last change: 2005 Jun 05 | |
1 | +*todo.txt* For Vim version 7.0aa. Last change: 2005 Jun 06 | |
2 | 2 | |
3 | 3 | |
4 | 4 | VIM REFERENCE MANUAL by Bram Moolenaar |
@@ -99,12 +99,16 @@ | ||
99 | 99 | Use array with flags, indicating if there is a word starting with this |
100 | 100 | byte. Quickly skip bytes where no word can start. |
101 | 101 | - Spell checking code todo's: |
102 | - - Implement user and project word lists. Commands to add words and to | |
103 | - mark words as wrong. | |
104 | 102 | - Also allow replacing a word list. Need some mechanism to tell |
105 | 103 | wether a spell file adds or replaces one found later in |
106 | 104 | 'runtimepath'. |
107 | - - Implement = flag in .dic: KEEPCASE for lower case word. | |
105 | + - Is "-" to be considered a word character? "last-minute". | |
106 | + No, in Dutch it can be added optionally. Then make English | |
107 | + dictionaries consistent. | |
108 | + - Implement user and project word lists. Commands to add words and to | |
109 | + mark words as wrong. | |
110 | + - In .aff use RAR to define affix name for rare word. | |
111 | + - In .aff use HUH to define affix name for keep-case word. | |
108 | 112 | 's morgens/= does not match 'S morgens |
109 | 113 | - Implement compound words? |
110 | 114 | - When @Spell and @NoSpell are both used only do spell checking for |
@@ -413,8 +417,6 @@ | ||
413 | 417 | |
414 | 418 | |
415 | 419 | Vi incompatibility: |
416 | -9 In Ex mode, "u" undoes all changes, not just the last one. (John Cowan) | |
417 | -8 In Ex mode, an empty file doesn't have a first line, "1p" should fail. | |
418 | 420 | 8 With undo/redo only marks in the changed lines should be changed. Other |
419 | 421 | marks should be kept. Vi keeps each mark at the same text, even when it |
420 | 422 | is deleted or restored. (Webb) |
@@ -1,4 +1,4 @@ | ||
1 | -*version7.txt* For Vim version 7.0aa. Last change: 2005 Jun 05 | |
1 | +*version7.txt* For Vim version 7.0aa. Last change: 2005 Jun 06 | |
2 | 2 | |
3 | 3 | |
4 | 4 | VIM REFERENCE MANUAL by Bram Moolenaar |
@@ -255,7 +255,8 @@ | ||
255 | 255 | - Autoindent for ":change" is using the first changed line. |
256 | 256 | - Editing Ex command lines is not done in cooked mode, because CTRL-D and |
257 | 257 | CTRL-T cannot be handled then. |
258 | -- In Ex mode, "1,3" prints three lines. | |
258 | +- In Ex mode, "1,3" prints three lines. "%" prints all lines. | |
259 | +- In Ex mode "undo" would undo all changes since Ex mode was started. | |
259 | 260 | - Implemented the 'prompt' option. |
260 | 261 | |
261 | 262 |
@@ -2,7 +2,7 @@ | ||
2 | 2 | " |
3 | 3 | " Language: Logtalk |
4 | 4 | " Maintainer: Paulo Moura <pmoura@logtalk.org> |
5 | -" Last Change: May 30, 2005 | |
5 | +" Last Change: June 6, 2005 | |
6 | 6 | |
7 | 7 | |
8 | 8 | " Quit when a syntax file was already loaded: |
@@ -48,23 +48,25 @@ | ||
48 | 48 | |
49 | 49 | " Logtalk opening entity directives |
50 | 50 | |
51 | -syn region logtalkOpenEntityDir matchgroup=logtalkOpenEntityDirTag start=":- object(" matchgroup=logtalkOpenEntityDirTag end=")\." contains=ALL | |
52 | -syn region logtalkOpenEntityDir matchgroup=logtalkOpenEntityDirTag start=":- protocol(" matchgroup=logtalkOpenEntityDirTag end=")\." contains=ALL | |
53 | -syn region logtalkOpenEntityDir matchgroup=logtalkOpenEntityDirTag start=":- category(" matchgroup=logtalkOpenEntityDirTag end=")\." contains=ALL | |
51 | +syn region logtalkOpenEntityDir matchgroup=logtalkOpenEntityDirTag start=":- object(" matchgroup=logtalkOpenEntityDirTag end=")\." contains=logtalkEntity,logtalkVariable,logtalkNumber,logtalkOperator,logtalkEntityRel | |
52 | +syn region logtalkOpenEntityDir matchgroup=logtalkOpenEntityDirTag start=":- protocol(" matchgroup=logtalkOpenEntityDirTag end=")\." contains=logtalkEntity,logtalkVariable,logtalkNumber,logtalkOperator,logtalkEntityRel | |
53 | +syn region logtalkOpenEntityDir matchgroup=logtalkOpenEntityDirTag start=":- category(" matchgroup=logtalkOpenEntityDirTag end=")\." contains=logtalkEntity,logtalkVariable,logtalkNumber,logtalkOperator,logtalkEntityRel | |
54 | 54 | |
55 | 55 | |
56 | 56 | " Logtalk closing entity directives |
57 | 57 | |
58 | -syn match logtalkCloseEntityDir ":- end_\(object\|protocol\|category\)\." | |
58 | +syn match logtalkCloseEntityDir ":- end_object\." | |
59 | +syn match logtalkCloseEntityDir ":- end_protocol\." | |
60 | +syn match logtalkCloseEntityDir ":- end_category\." | |
59 | 61 | |
60 | 62 | |
61 | 63 | " Logtalk entity relations |
62 | 64 | |
63 | -syn region logtalkEntityRel matchgroup=logtalkEntityRelTag start="instantiates(" matchgroup=logtalkEntityRelTag end=")" contains=logtalkEntity contained | |
64 | -syn region logtalkEntityRel matchgroup=logtalkEntityRelTag start="specializes(" matchgroup=logtalkEntityRelTag end=")" contains=logtalkEntity contained | |
65 | -syn region logtalkEntityRel matchgroup=logtalkEntityRelTag start="extends(" matchgroup=logtalkEntityRelTag end=")" contains=logtalkEntity contained | |
66 | -syn region logtalkEntityRel matchgroup=logtalkEntityRelTag start="imports(" matchgroup=logtalkEntityRelTag end=")" contains=logtalkEntity contained | |
67 | -syn region logtalkEntityRel matchgroup=logtalkEntityRelTag start="implements(" matchgroup=logtalkEntityRelTag end=")" contains=logtalkEntity contained | |
65 | +syn region logtalkEntityRel matchgroup=logtalkEntityRelTag start="instantiates(" matchgroup=logtalkEntityRelTag end=")" contains=logtalkEntity,logtalkVariable,logtalkNumber,logtalkOperator contained | |
66 | +syn region logtalkEntityRel matchgroup=logtalkEntityRelTag start="specializes(" matchgroup=logtalkEntityRelTag end=")" contains=logtalkEntity,logtalkVariable,logtalkNumber,logtalkOperator contained | |
67 | +syn region logtalkEntityRel matchgroup=logtalkEntityRelTag start="extends(" matchgroup=logtalkEntityRelTag end=")" contains=logtalkEntity,logtalkVariable,logtalkNumber,logtalkOperator contained | |
68 | +syn region logtalkEntityRel matchgroup=logtalkEntityRelTag start="imports(" matchgroup=logtalkEntityRelTag end=")" contains=logtalkEntity,logtalkVariable,logtalkNumber,logtalkOperator contained | |
69 | +syn region logtalkEntityRel matchgroup=logtalkEntityRelTag start="implements(" matchgroup=logtalkEntityRelTag end=")" contains=logtalkEntity,logtalkVariable,logtalkNumber,logtalkOperator contained | |
68 | 70 | |
69 | 71 | |
70 | 72 | " Logtalk directives |
@@ -297,9 +299,9 @@ | ||
297 | 299 | syn match logtalkNumber "\<\d\+\.\d\+\>" |
298 | 300 | syn match logtalkNumber "\<\d\+[eE][-+]\=\d\+\>" |
299 | 301 | syn match logtalkNumber "\<\d\+\.\d\+[eE][-+]\=\d\+\>" |
300 | -syn match logtalkNumber "\<0'[0-9a-zA-Z]\>" | |
302 | +syn match logtalkNumber "\<0'.\>" | |
301 | 303 | syn match logtalkNumber "\<0b[0-1]\+\>" |
302 | -syn match logtalkNumber "\<0o[0-7]\+\>" | |
304 | +syn match logtalkNumber "\<0o\o\+\>" | |
303 | 305 | syn match logtalkNumber "\<0x\x\+\>" |
304 | 306 | |
305 | 307 |
@@ -310,10 +312,17 @@ | ||
310 | 312 | |
311 | 313 | " Logtalk comments |
312 | 314 | |
313 | -syn region logtalkBlockComment start="/\*" end="\*/" | |
315 | +syn region logtalkBlockComment start="/\*" end="\*/" fold | |
314 | 316 | syn match logtalkLineComment "%.*" |
315 | 317 | |
316 | 318 | |
319 | +" Logtalk entity folding | |
320 | + | |
321 | +syn region logtalkEntity transparent fold keepend start=":- object(" end=":- end_object\." contains=ALL | |
322 | +syn region logtalkEntity transparent fold keepend start=":- protocol(" end=":- end_protocol\." contains=ALL | |
323 | +syn region logtalkEntity transparent fold keepend start=":- category(" end=":- end_category\." contains=ALL | |
324 | + | |
325 | + | |
317 | 326 | syn sync ccomment logtalkBlockComment maxlines=50 |
318 | 327 | |
319 | 328 |
@@ -370,3 +379,5 @@ | ||
370 | 379 | let b:current_syntax = "logtalk" |
371 | 380 | |
372 | 381 | setlocal ts=4 |
382 | +setlocal fdm=syntax | |
383 | +setlocal fdc=2 |
@@ -914,382 +914,6 @@ | ||
914 | 914 | # endif |
915 | 915 | return (GET_CHARTAB(buf, *p) != 0); |
916 | 916 | } |
917 | - | |
918 | -/* | |
919 | - * The tables used for spelling. These are only used for the first 256 | |
920 | - * characters. | |
921 | - */ | |
922 | -typedef struct spelltab_S | |
923 | -{ | |
924 | - char_u st_isw[256]; /* flags: is word char */ | |
925 | - char_u st_isu[256]; /* flags: is uppercase char */ | |
926 | - char_u st_fold[256]; /* chars: folded case */ | |
927 | -} spelltab_T; | |
928 | - | |
929 | -static spelltab_T spelltab; | |
930 | -static int did_set_spelltab; | |
931 | - | |
932 | -#define SPELL_ISWORD 1 | |
933 | -#define SPELL_ISUPPER 2 | |
934 | - | |
935 | -static void clear_spell_chartab __ARGS((spelltab_T *sp)); | |
936 | -static int set_spell_finish __ARGS((spelltab_T *new_st)); | |
937 | - | |
938 | -/* | |
939 | - * Init the chartab used for spelling for ASCII. | |
940 | - * EBCDIC is not supported! | |
941 | - */ | |
942 | - static void | |
943 | -clear_spell_chartab(sp) | |
944 | - spelltab_T *sp; | |
945 | -{ | |
946 | - int i; | |
947 | - | |
948 | - /* Init everything to FALSE. */ | |
949 | - vim_memset(sp->st_isw, FALSE, sizeof(sp->st_isw)); | |
950 | - vim_memset(sp->st_isu, FALSE, sizeof(sp->st_isu)); | |
951 | - for (i = 0; i < 256; ++i) | |
952 | - sp->st_fold[i] = i; | |
953 | - | |
954 | - /* We include digits. A word shouldn't start with a digit, but handling | |
955 | - * that is done separately. */ | |
956 | - for (i = '0'; i <= '9'; ++i) | |
957 | - sp->st_isw[i] = TRUE; | |
958 | - for (i = 'A'; i <= 'Z'; ++i) | |
959 | - { | |
960 | - sp->st_isw[i] = TRUE; | |
961 | - sp->st_isu[i] = TRUE; | |
962 | - sp->st_fold[i] = i + 0x20; | |
963 | - } | |
964 | - for (i = 'a'; i <= 'z'; ++i) | |
965 | - sp->st_isw[i] = TRUE; | |
966 | -} | |
967 | - | |
968 | -/* | |
969 | - * Init the chartab used for spelling. Only depends on 'encoding'. | |
970 | - * Called once while starting up and when 'encoding' changes. | |
971 | - * The default is to use isalpha(), but the spell file should define the word | |
972 | - * characters to make it possible that 'encoding' differs from the current | |
973 | - * locale. | |
974 | - */ | |
975 | - void | |
976 | -init_spell_chartab() | |
977 | -{ | |
978 | - int i; | |
979 | - | |
980 | - did_set_spelltab = FALSE; | |
981 | - clear_spell_chartab(&spelltab); | |
982 | - | |
983 | -#ifdef FEAT_MBYTE | |
984 | - if (enc_dbcs) | |
985 | - { | |
986 | - /* DBCS: assume double-wide characters are word characters. */ | |
987 | - for (i = 128; i <= 255; ++i) | |
988 | - if (MB_BYTE2LEN(i) == 2) | |
989 | - spelltab.st_isw[i] = TRUE; | |
990 | - } | |
991 | - else | |
992 | -#endif | |
993 | - { | |
994 | - /* Rough guess: use isalpha() and isupper() for characters above 128. | |
995 | - * */ | |
996 | - for (i = 128; i < 256; ++i) | |
997 | - { | |
998 | - spelltab.st_isw[i] = MB_ISUPPER(i) || MB_ISLOWER(i); | |
999 | - if (MB_ISUPPER(i)) | |
1000 | - { | |
1001 | - spelltab.st_isu[i] = TRUE; | |
1002 | - spelltab.st_fold[i] = MB_TOLOWER(i); | |
1003 | - } | |
1004 | - } | |
1005 | - } | |
1006 | -} | |
1007 | - | |
1008 | -#if defined(FEAT_MBYTE) || defined(PROTO) | |
1009 | -static char *e_affform = N_("E761: Format error in affix file FOL, LOW or UPP"); | |
1010 | -static char *e_affrange = N_("E762: Character in FOL, LOW or UPP is out of range"); | |
1011 | - | |
1012 | -/* | |
1013 | - * Set the spell character tables from strings in the affix file. | |
1014 | - */ | |
1015 | - int | |
1016 | -set_spell_chartab(fol, low, upp) | |
1017 | - char_u *fol; | |
1018 | - char_u *low; | |
1019 | - char_u *upp; | |
1020 | -{ | |
1021 | - /* We build the new tables here first, so that we can compare with the | |
1022 | - * previous one. */ | |
1023 | - spelltab_T new_st; | |
1024 | - char_u *pf = fol, *pl = low, *pu = upp; | |
1025 | - int f, l, u; | |
1026 | - | |
1027 | - clear_spell_chartab(&new_st); | |
1028 | - | |
1029 | - while (*pf != NUL) | |
1030 | - { | |
1031 | - if (*pl == NUL || *pu == NUL) | |
1032 | - { | |
1033 | - EMSG(_(e_affform)); | |
1034 | - return FAIL; | |
1035 | - } | |
1036 | -#ifdef FEAT_MBYTE | |
1037 | - f = mb_ptr2char_adv(&pf); | |
1038 | - l = mb_ptr2char_adv(&pl); | |
1039 | - u = mb_ptr2char_adv(&pu); | |
1040 | -#else | |
1041 | - f = *pf++; | |
1042 | - l = *pl++; | |
1043 | - u = *pu++; | |
1044 | -#endif | |
1045 | - /* Every character that appears is a word character. */ | |
1046 | - if (f < 256) | |
1047 | - new_st.st_isw[f] = TRUE; | |
1048 | - if (l < 256) | |
1049 | - new_st.st_isw[l] = TRUE; | |
1050 | - if (u < 256) | |
1051 | - new_st.st_isw[u] = TRUE; | |
1052 | - | |
1053 | - /* if "LOW" and "FOL" are not the same the "LOW" char needs | |
1054 | - * case-folding */ | |
1055 | - if (l < 256 && l != f) | |
1056 | - { | |
1057 | - if (f >= 256) | |
1058 | - { | |
1059 | - EMSG(_(e_affrange)); | |
1060 | - return FAIL; | |
1061 | - } | |
1062 | - new_st.st_fold[l] = f; | |
1063 | - } | |
1064 | - | |
1065 | - /* if "UPP" and "FOL" are not the same the "UPP" char needs | |
1066 | - * case-folding and it's upper case. */ | |
1067 | - if (u < 256 && u != f) | |
1068 | - { | |
1069 | - if (f >= 256) | |
1070 | - { | |
1071 | - EMSG(_(e_affrange)); | |
1072 | - return FAIL; | |
1073 | - } | |
1074 | - new_st.st_fold[u] = f; | |
1075 | - new_st.st_isu[u] = TRUE; | |
1076 | - } | |
1077 | - } | |
1078 | - | |
1079 | - if (*pl != NUL || *pu != NUL) | |
1080 | - { | |
1081 | - EMSG(_(e_affform)); | |
1082 | - return FAIL; | |
1083 | - } | |
1084 | - | |
1085 | - return set_spell_finish(&new_st); | |
1086 | -} | |
1087 | -#endif | |
1088 | - | |
1089 | -/* | |
1090 | - * Set the spell character tables from strings in the .spl file. | |
1091 | - */ | |
1092 | - int | |
1093 | -set_spell_charflags(flags, cnt, upp) | |
1094 | - char_u *flags; | |
1095 | - int cnt; | |
1096 | - char_u *upp; | |
1097 | -{ | |
1098 | - /* We build the new tables here first, so that we can compare with the | |
1099 | - * previous one. */ | |
1100 | - spelltab_T new_st; | |
1101 | - int i; | |
1102 | - char_u *p = upp; | |
1103 | - | |
1104 | - clear_spell_chartab(&new_st); | |
1105 | - | |
1106 | - for (i = 0; i < cnt; ++i) | |
1107 | - { | |
1108 | - new_st.st_isw[i + 128] = (flags[i] & SPELL_ISWORD) != 0; | |
1109 | - new_st.st_isu[i + 128] = (flags[i] & SPELL_ISUPPER) != 0; | |
1110 | - | |
1111 | - if (*p == NUL) | |
1112 | - return FAIL; | |
1113 | -#ifdef FEAT_MBYTE | |
1114 | - new_st.st_fold[i + 128] = mb_ptr2char_adv(&p); | |
1115 | -#else | |
1116 | - new_st.st_fold[i + 128] = *p++; | |
1117 | -#endif | |
1118 | - } | |
1119 | - | |
1120 | - return set_spell_finish(&new_st); | |
1121 | -} | |
1122 | - | |
1123 | - static int | |
1124 | -set_spell_finish(new_st) | |
1125 | - spelltab_T *new_st; | |
1126 | -{ | |
1127 | - int i; | |
1128 | - | |
1129 | - if (did_set_spelltab) | |
1130 | - { | |
1131 | - /* check that it's the same table */ | |
1132 | - for (i = 0; i < 256; ++i) | |
1133 | - { | |
1134 | - if (spelltab.st_isw[i] != new_st->st_isw[i] | |
1135 | - || spelltab.st_isu[i] != new_st->st_isu[i] | |
1136 | - || spelltab.st_fold[i] != new_st->st_fold[i]) | |
1137 | - { | |
1138 | - EMSG(_("E763: Word characters differ between spell files")); | |
1139 | - return FAIL; | |
1140 | - } | |
1141 | - } | |
1142 | - } | |
1143 | - else | |
1144 | - { | |
1145 | - /* copy the new spelltab into the one being used */ | |
1146 | - spelltab = *new_st; | |
1147 | - did_set_spelltab = TRUE; | |
1148 | - } | |
1149 | - | |
1150 | - return OK; | |
1151 | -} | |
1152 | - | |
1153 | -#if defined(FEAT_MBYTE) || defined(PROTO) | |
1154 | -/* | |
1155 | - * Write the current tables into the .spl file. | |
1156 | - * This makes sure the same characters are recognized as word characters when | |
1157 | - * generating an when using a spell file. | |
1158 | - */ | |
1159 | - void | |
1160 | -write_spell_chartab(fd) | |
1161 | - FILE *fd; | |
1162 | -{ | |
1163 | - char_u charbuf[256 * 4]; | |
1164 | - int len = 0; | |
1165 | - int flags; | |
1166 | - int i; | |
1167 | - | |
1168 | - fputc(128, fd); /* <charflagslen> */ | |
1169 | - for (i = 128; i < 256; ++i) | |
1170 | - { | |
1171 | - flags = 0; | |
1172 | - if (spelltab.st_isw[i]) | |
1173 | - flags |= SPELL_ISWORD; | |
1174 | - if (spelltab.st_isu[i]) | |
1175 | - flags |= SPELL_ISUPPER; | |
1176 | - fputc(flags, fd); /* <charflags> */ | |
1177 | - | |
1178 | - len += mb_char2bytes(spelltab.st_fold[i], charbuf + len); | |
1179 | - } | |
1180 | - | |
1181 | - put_bytes(fd, (long_u)len, 2); /* <fcharlen> */ | |
1182 | - fwrite(charbuf, (size_t)len, (size_t)1, fd); /* <fchars> */ | |
1183 | -} | |
1184 | -#endif | |
1185 | - | |
1186 | -/* | |
1187 | - * Return TRUE if "p" points to a word character for spelling. | |
1188 | - */ | |
1189 | - int | |
1190 | -spell_iswordc(p) | |
1191 | - char_u *p; | |
1192 | -{ | |
1193 | -# ifdef FEAT_MBYTE | |
1194 | - if (has_mbyte && MB_BYTE2LEN(*p) > 1) | |
1195 | - return mb_get_class(p) >= 2; | |
1196 | -# endif | |
1197 | - return spelltab.st_isw[*p]; | |
1198 | -} | |
1199 | - | |
1200 | -/* | |
1201 | - * Return TRUE if "c" is an upper-case character for spelling. | |
1202 | - */ | |
1203 | - int | |
1204 | -spell_isupper(c) | |
1205 | - int c; | |
1206 | -{ | |
1207 | -# ifdef FEAT_MBYTE | |
1208 | - if (enc_utf8) | |
1209 | - { | |
1210 | - /* For Unicode we can call utf_isupper(), but don't do that for ASCII, | |
1211 | - * because we don't want to use 'casemap' here. */ | |
1212 | - if (c >= 128) | |
1213 | - return utf_isupper(c); | |
1214 | - } | |
1215 | - else if (has_mbyte && c > 256) | |
1216 | - { | |
1217 | - /* For characters above 255 we don't have something specfied. | |
1218 | - * Fall back to locale-dependent iswupper(). If not available | |
1219 | - * simply return FALSE. */ | |
1220 | -# ifdef HAVE_ISWUPPER | |
1221 | - return iswupper(c); | |
1222 | -# else | |
1223 | - return FALSE; | |
1224 | -# endif | |
1225 | - } | |
1226 | -# endif | |
1227 | - return spelltab.st_isu[c]; | |
1228 | -} | |
1229 | - | |
1230 | -/* | |
1231 | - * case-fold "p[len]" into "buf[buflen]". Used for spell checking. | |
1232 | - * Returns FAIL when something wrong. | |
1233 | - */ | |
1234 | - int | |
1235 | -spell_casefold(p, len, buf, buflen) | |
1236 | - char_u *p; | |
1237 | - int len; | |
1238 | - char_u *buf; | |
1239 | - int buflen; | |
1240 | -{ | |
1241 | - int i; | |
1242 | - | |
1243 | - if (len >= buflen) | |
1244 | - { | |
1245 | - buf[0] = NUL; | |
1246 | - return FAIL; /* result will not fit */ | |
1247 | - } | |
1248 | - | |
1249 | -#ifdef FEAT_MBYTE | |
1250 | - if (has_mbyte) | |
1251 | - { | |
1252 | - int c; | |
1253 | - int outi = 0; | |
1254 | - | |
1255 | - /* Fold one character at a time. */ | |
1256 | - for (i = 0; i < len; i += mb_ptr2len_check(p + i)) | |
1257 | - { | |
1258 | - c = mb_ptr2char(p + i); | |
1259 | - if (enc_utf8) | |
1260 | - /* For Unicode case folding is always the same, no need to use | |
1261 | - * the table from the spell file. */ | |
1262 | - c = utf_fold(c); | |
1263 | - else if (c < 256) | |
1264 | - /* Use the table from the spell file. */ | |
1265 | - c = spelltab.st_fold[c]; | |
1266 | -# ifdef HAVE_TOWLOWER | |
1267 | - else | |
1268 | - /* We don't know what to do, fall back to towlower(), it | |
1269 | - * depends on the current locale. */ | |
1270 | - c = towlower(c); | |
1271 | -# endif | |
1272 | - if (outi + MB_MAXBYTES > buflen) | |
1273 | - { | |
1274 | - buf[outi] = NUL; | |
1275 | - return FAIL; | |
1276 | - } | |
1277 | - outi += mb_char2bytes(c, buf + outi); | |
1278 | - } | |
1279 | - buf[outi] = NUL; | |
1280 | - } | |
1281 | - else | |
1282 | -#endif | |
1283 | - { | |
1284 | - /* Be quick for non-multibyte encodings. */ | |
1285 | - for (i = 0; i < len; ++i) | |
1286 | - buf[i] = spelltab.st_fold[p[i]]; | |
1287 | - buf[i] = NUL; | |
1288 | - } | |
1289 | - | |
1290 | - return OK; | |
1291 | -} | |
1292 | - | |
1293 | 917 | #endif /* FEAT_SYN_HL */ |
1294 | 918 | |
1295 | 919 | /* |
@@ -4185,6 +4185,7 @@ | ||
4185 | 4185 | {"brown", RGB(0x80, 0x40, 0x40)}, /*W*/ |
4186 | 4186 | {"yellow", RGB(0xFC, 0xF3, 0x05)}, /*M*/ |
4187 | 4187 | {"lightyellow", RGB(0xFF, 0xFF, 0xA0)}, /*M*/ |
4188 | + {"darkyellow", RGB(0xBB, 0xBB, 0x00)}, /*U*/ | |
4188 | 4189 | {"SeaGreen", RGB(0x2E, 0x8B, 0x57)}, /*W 0x4E8975 */ |
4189 | 4190 | {"orange", RGB(0xFC, 0x80, 0x00)}, /*W 0xF87A17 */ |
4190 | 4191 | {"Purple", RGB(0xA0, 0x20, 0xF0)}, /*W 0x8e35e5 */ |
@@ -2192,6 +2192,7 @@ | ||
2192 | 2192 | { |
2193 | 2193 | int i, j, l; |
2194 | 2194 | int cdiff; |
2195 | + int incomplete = FALSE; | |
2195 | 2196 | int n = nn; |
2196 | 2197 | |
2197 | 2198 | for (i = 0; i < n; i += l) |
@@ -2202,7 +2203,10 @@ | ||
2202 | 2203 | { |
2203 | 2204 | l = utf_byte2len(s1[i]); |
2204 | 2205 | if (l > n - i) |
2206 | + { | |
2205 | 2207 | l = n - i; /* incomplete character */ |
2208 | + incomplete = TRUE; | |
2209 | + } | |
2206 | 2210 | /* Check directly first, it's faster. */ |
2207 | 2211 | for (j = 0; j < l; ++j) |
2208 | 2212 | if (s1[i + j] != s2[i + j]) |
@@ -2210,7 +2214,7 @@ | ||
2210 | 2214 | if (j < l) |
2211 | 2215 | { |
2212 | 2216 | /* If one of the two characters is incomplete return -1. */ |
2213 | - if (i + utf_byte2len(s1[i]) > n || i + utf_byte2len(s2[i]) > n) | |
2217 | + if (incomplete || i + utf_byte2len(s2[i]) > n) | |
2214 | 2218 | return -1; |
2215 | 2219 | cdiff = utf_fold(utf_ptr2char(s1 + i)) |
2216 | 2220 | - utf_fold(utf_ptr2char(s2 + i)); |
@@ -5,4 +5,5 @@ | ||
5 | 5 | void spell_reload __ARGS((void)); |
6 | 6 | void put_bytes __ARGS((FILE *fd, long_u nr, int len)); |
7 | 7 | void ex_mkspell __ARGS((exarg_T *eap)); |
8 | +void init_spell_chartab __ARGS((void)); | |
8 | 9 | /* vim: set ft=c : */ |
@@ -322,9 +322,9 @@ | ||
322 | 322 | |
323 | 323 | /* Used for an error (down from) vim_regcomp(): give the error message, set |
324 | 324 | * rc_did_emsg and return NULL */ |
325 | -#define EMSG_RET_NULL(m) { EMSG(m); rc_did_emsg = TRUE; return NULL; } | |
326 | -#define EMSG_M_RET_NULL(m, c) { EMSG2(m, c ? "" : "\\"); rc_did_emsg = TRUE; return NULL; } | |
327 | -#define EMSG_RET_FAIL(m) { EMSG(m); rc_did_emsg = TRUE; return FAIL; } | |
325 | +#define EMSG_RET_NULL(m) return (EMSG(m), rc_did_emsg = TRUE, NULL) | |
326 | +#define EMSG_M_RET_NULL(m, c) return (EMSG2((m), (c) ? "" : "\\"), rc_did_emsg = TRUE, NULL) | |
327 | +#define EMSG_RET_FAIL(m) return (EMSG(m), rc_did_emsg = TRUE, FAIL) | |
328 | 328 | #define EMSG_ONE_RET_NULL EMSG_M_RET_NULL(_("E369: invalid item in %s%%[]"), reg_magic == MAGIC_ALL) |
329 | 329 | |
330 | 330 | #define MAX_LIMIT (32767L << 16L) |
@@ -1246,20 +1246,20 @@ | ||
1246 | 1246 | { |
1247 | 1247 | #ifdef FEAT_SYN_HL |
1248 | 1248 | if (paren == REG_ZPAREN) |
1249 | - EMSG_RET_NULL(_("E52: Unmatched \\z(")) | |
1249 | + EMSG_RET_NULL(_("E52: Unmatched \\z(")); | |
1250 | 1250 | else |
1251 | 1251 | #endif |
1252 | 1252 | if (paren == REG_NPAREN) |
1253 | - EMSG_M_RET_NULL(_("E53: Unmatched %s%%("), reg_magic == MAGIC_ALL) | |
1253 | + EMSG_M_RET_NULL(_("E53: Unmatched %s%%("), reg_magic == MAGIC_ALL); | |
1254 | 1254 | else |
1255 | - EMSG_M_RET_NULL(_("E54: Unmatched %s("), reg_magic == MAGIC_ALL) | |
1255 | + EMSG_M_RET_NULL(_("E54: Unmatched %s("), reg_magic == MAGIC_ALL); | |
1256 | 1256 | } |
1257 | 1257 | else if (paren == REG_NOPAREN && peekchr() != NUL) |
1258 | 1258 | { |
1259 | 1259 | if (curchr == Magic(')')) |
1260 | - EMSG_M_RET_NULL(_("E55: Unmatched %s)"), reg_magic == MAGIC_ALL) | |
1260 | + EMSG_M_RET_NULL(_("E55: Unmatched %s)"), reg_magic == MAGIC_ALL); | |
1261 | 1261 | else |
1262 | - EMSG_RET_NULL(_(e_trailing)) /* "Can't happen". */ | |
1262 | + EMSG_RET_NULL(_(e_trailing)); /* "Can't happen". */ | |
1263 | 1263 | /* NOTREACHED */ |
1264 | 1264 | } |
1265 | 1265 | /* |
@@ -2985,7 +2985,6 @@ | ||
2985 | 2985 | char_u *ptr; |
2986 | 2986 | lpos_T pos; |
2987 | 2987 | } se_u; |
2988 | - int se_len; | |
2989 | 2988 | } save_se_T; |
2990 | 2989 | |
2991 | 2990 | static char_u *reg_getline __ARGS((linenr_T lnum)); |
@@ -6028,7 +6028,7 @@ | ||
6028 | 6028 | "Folded term=standout ctermbg=Grey ctermfg=DarkBlue guibg=LightGrey guifg=DarkBlue", |
6029 | 6029 | "FoldColumn term=standout ctermbg=Grey ctermfg=DarkBlue guibg=Grey guifg=DarkBlue", |
6030 | 6030 | "SignColumn term=standout ctermbg=Grey ctermfg=DarkBlue guibg=Grey guifg=DarkBlue", |
6031 | - "Visual term=reverse ctermbg=Grey guibg=Grey", | |
6031 | + "Visual term=reverse ctermbg=LightGrey guibg=LightGrey", | |
6032 | 6032 | "DiffAdd term=bold ctermbg=LightBlue guibg=LightBlue", |
6033 | 6033 | "DiffChange term=bold ctermbg=LightMagenta guibg=LightMagenta", |
6034 | 6034 | "DiffDelete term=bold ctermfg=Blue ctermbg=LightCyan gui=bold guifg=Blue guibg=LightCyan", |
@@ -6053,7 +6053,7 @@ | ||
6053 | 6053 | "Folded term=standout ctermbg=DarkGrey ctermfg=Cyan guibg=DarkGrey guifg=Cyan", |
6054 | 6054 | "FoldColumn term=standout ctermbg=DarkGrey ctermfg=Cyan guibg=Grey guifg=Cyan", |
6055 | 6055 | "SignColumn term=standout ctermbg=DarkGrey ctermfg=Cyan guibg=Grey guifg=Cyan", |
6056 | - "Visual term=reverse ctermbg=Grey guibg=Grey", | |
6056 | + "Visual term=reverse ctermbg=DarkGrey guibg=DarkGrey", | |
6057 | 6057 | "DiffAdd term=bold ctermbg=DarkBlue guibg=DarkBlue", |
6058 | 6058 | "DiffChange term=bold ctermbg=DarkMagenta guibg=DarkMagenta", |
6059 | 6059 | "DiffDelete term=bold ctermfg=Blue ctermbg=DarkCyan gui=bold guifg=Blue guibg=DarkCyan", |
@@ -36,5 +36,5 @@ | ||
36 | 36 | #define VIM_VERSION_NODOT "vim70aa" |
37 | 37 | #define VIM_VERSION_SHORT "7.0aa" |
38 | 38 | #define VIM_VERSION_MEDIUM "7.0aa ALPHA" |
39 | -#define VIM_VERSION_LONG "VIM - Vi IMproved 7.0aa ALPHA (2005 Jun 5)" | |
40 | -#define VIM_VERSION_LONG_DATE "VIM - Vi IMproved 7.0aa ALPHA (2005 Jun 5, compiled " | |
39 | +#define VIM_VERSION_LONG "VIM - Vi IMproved 7.0aa ALPHA (2005 Jun 6)" | |
40 | +#define VIM_VERSION_LONG_DATE "VIM - Vi IMproved 7.0aa ALPHA (2005 Jun 6, compiled " |