Mirror of the Vim source from https://github.com/vim/vim
修訂 | a0451524244d6387ea49cfda296f6550a2a9aebd (tree) |
---|---|
時間 | 2005-06-08 06:12:49 |
作者 | vimboss |
Commiter | vimboss |
updated for version 7.0082
@@ -1,4 +1,4 @@ | ||
1 | -*todo.txt* For Vim version 7.0aa. Last change: 2005 Jun 06 | |
1 | +*todo.txt* For Vim version 7.0aa. Last change: 2005 Jun 07 | |
2 | 2 | |
3 | 3 | |
4 | 4 | VIM REFERENCE MANUAL by Bram Moolenaar |
@@ -30,9 +30,6 @@ | ||
30 | 30 | *known-bugs* |
31 | 31 | -------------------- Known bugs and current work ----------------------- |
32 | 32 | |
33 | -Patch in if_cscope.c also in 6.3? (Froloff) | |
34 | - Sergey says it's OK. | |
35 | - | |
36 | 33 | Add extra list of file locations. Can be used with: |
37 | 34 | :ltag list of matching tags, like :tselect |
38 | 35 |
@@ -95,21 +92,10 @@ | ||
95 | 92 | |
96 | 93 | - Add SPELLCHECKER, with support for many languages. |
97 | 94 | - Use "engspchk" from Charles Campbell for ideas (commands, rare words). |
98 | - - Should quickly return if there is no word with the character. | |
99 | - Use array with flags, indicating if there is a word starting with this | |
100 | - byte. Quickly skip bytes where no word can start. | |
101 | 95 | - Spell checking code todo's: |
102 | - - Also allow replacing a word list. Need some mechanism to tell | |
103 | - wether a spell file adds or replaces one found later in | |
104 | - 'runtimepath'. | |
105 | 96 | - Is "-" to be considered a word character? "last-minute". |
106 | 97 | No, in Dutch it can be added optionally. Then make English |
107 | 98 | 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. | |
112 | - 's morgens/= does not match 'S morgens | |
113 | 99 | - Implement compound words? |
114 | 100 | - When @Spell and @NoSpell are both used only do spell checking for |
115 | 101 | @Spell items, not where they both appear. Useful for Perl pod. |
@@ -125,11 +111,8 @@ | ||
125 | 111 | author: Kevin Hendricks <kevin.hendricks@sympatico.ca> |
126 | 112 | - More complicated: Regions with different languages? E.g. comments in |
127 | 113 | English, strings in German (po file). |
128 | - - Commands required: | |
129 | - add word to private dict: wrong and OK (in popup menu for evim) | |
130 | - :spell good <word> zg | |
131 | - :spell wrong <word> zw | |
132 | - - Update option window for 'verbosefile', 'spell' and 'spelllang'. | |
114 | + - Update option window for 'verbosefile', 'spell', 'spellfile' and | |
115 | + 'spelllang'. | |
133 | 116 | - Distribution: Need wordlists for many languages; "language pack" |
134 | 117 | Put them on the ftp site, ready to download. Include README for |
135 | 118 | copyrights. |
@@ -143,7 +126,8 @@ | ||
143 | 126 | cluster" but change the contains list directly for matching syntax |
144 | 127 | items. |
145 | 128 | - Install spell files with src/main.aap. |
146 | - Alternatives using ispell or aspell: | |
129 | + - Alternate Dutch word list at www.nederlandsewoorden.nl (use script to | |
130 | + obtain). | |
147 | 131 | |
148 | 132 | - REFACTORING: The main() function is very long. Move parts to separate |
149 | 133 | functions, especially loops. Ideas from Walter Briscoe (2003 Apr 3, 2004 |
@@ -1,4 +1,4 @@ | ||
1 | -*version7.txt* For Vim version 7.0aa. Last change: 2005 Jun 06 | |
1 | +*version7.txt* For Vim version 7.0aa. Last change: 2005 Jun 07 | |
2 | 2 | |
3 | 3 | |
4 | 4 | VIM REFERENCE MANUAL by Bram Moolenaar |
@@ -428,6 +428,8 @@ | ||
428 | 428 | |
429 | 429 | Sive syntax file. (Nikolai Weibull) |
430 | 430 | |
431 | +Pascal indent file. (Neil Carter) | |
432 | + | |
431 | 433 | Moved all the indent settings from the filetype plugin to the indent file. |
432 | 434 | Implemented b:undo_indent to undo indent settings when setting 'filetype' to a |
433 | 435 | different value. |
@@ -0,0 +1,173 @@ | ||
1 | +" Vim indent file | |
2 | +" Language: Pascal | |
3 | +" Maintainer: Neil Carter <n.carter@swansea.ac.uk> | |
4 | +" Created: 2004 Jul 13 | |
5 | +" Last Change: 2005 Jun 07 | |
6 | +" TODO: Reduce indentation on line after a statement that flowed across | |
7 | +" two lines (e.g. parameter list closed on second line). Also, increase | |
8 | +" indent of a becomes-statement that flows onto second line. | |
9 | + | |
10 | +" Only load this indent file when no other was loaded. | |
11 | +if exists("b:did_indent") | |
12 | + finish | |
13 | +endif | |
14 | +let b:did_indent = 1 | |
15 | + | |
16 | +setlocal indentexpr=GetPascalIndent(v:lnum) | |
17 | +" Appending an & to an option sets it to its default value. | |
18 | +setlocal indentkeys& | |
19 | +setlocal indentkeys+=~end;,=~const,=~type,=~var,=~begin,=~repeat,=~until,=~for | |
20 | +setlocal indentkeys+=~program,=~function,=~procedure,=~object,=~private | |
21 | +setlocal indentkeys+=~record,=~if,=~else,=~case | |
22 | + | |
23 | +if exists("*GetPascalIndent") | |
24 | + finish | |
25 | +endif | |
26 | + | |
27 | + | |
28 | +function s:GetPrevLineNum( line_num ) | |
29 | + | |
30 | + " Skip over comments and conditional directives | |
31 | + let SKIP_LINES = '^\s*\((\*\)\|\(\*\ \)\|\(\*)\)\|\({\$\)' | |
32 | + | |
33 | + let nline = a:line_num | |
34 | + while nline > 0 | |
35 | + let nline = prevnonblank(nline-1) | |
36 | + if getline(nline) !~? SKIP_LINES | |
37 | + break | |
38 | + endif | |
39 | + endwhile | |
40 | + | |
41 | +" call input( "nline = ".nline ) | |
42 | + | |
43 | + return nline | |
44 | + | |
45 | +endfunction | |
46 | + | |
47 | + | |
48 | +function! GetPascalIndent( line_num ) | |
49 | + if a:line_num == 0 | |
50 | + return 0 | |
51 | + endif | |
52 | + | |
53 | + " If in the middle of a three-part comment | |
54 | + if getline( a:line_num ) =~ '^\s*\*\ ' | |
55 | + return indent( a:line_num ) | |
56 | + endif | |
57 | + | |
58 | + " We have to subtract one to start on the line before the current | |
59 | + " one. Otherwise, prevnonblank() returns the current line! | |
60 | + let prev_line_num = s:GetPrevLineNum( a:line_num ) | |
61 | + let prev_line = getline( prev_line_num ) | |
62 | + let indnt = indent( prev_line_num ) | |
63 | + | |
64 | + let this_line = getline( a:line_num ) | |
65 | + | |
66 | + " At the start of a block, we have to indent the newly-created line | |
67 | + " based on the previous line. | |
68 | + " =~ means matches a regular expression | |
69 | + " a question mark after =~ means ignore case (# means match case) | |
70 | + " const, type, var should always appear at the start of a line, but | |
71 | + " begin can appear anywhere in the line. | |
72 | + " if one of the following keywords appear in the previous line with | |
73 | + " nothing before it but optional whitespace, and nothing after it. | |
74 | + " Has to be end of line at end to show this is not a routine | |
75 | + " parameter list. Otherwise, you'd end up with cascading vars. | |
76 | + | |
77 | + " These words appear alone on a line (apart from whitespace). | |
78 | + if prev_line =~ '^\s*\(const\|var\|begin\|repeat\|private\)$' | |
79 | + " Place an & before an option to obtain its value. | |
80 | + let indnt = indnt + &shiftwidth | |
81 | + endif | |
82 | + | |
83 | + " Words preceded by optional whitespace and followed by anything. | |
84 | + if prev_line =~ '^\s*\(for\|if\|else\|case\)' | |
85 | + " Place an & before an option to obtain its value. | |
86 | + let indnt = indnt + &shiftwidth | |
87 | + " if this is a multistatement block then we need to align the | |
88 | + " begin with the previous line. | |
89 | + if this_line =~ '^\s*begin' | |
90 | + let indnt = indnt - &shiftwidth | |
91 | + endif | |
92 | + endif | |
93 | + " These words may have text before them on the line (hence the .*). | |
94 | + if prev_line =~ '^.*\s*\<\(object\|record\)\>$' | |
95 | + let indnt = indnt + &shiftwidth | |
96 | + endif | |
97 | + " If we have opened a bracket and the contents spills over one line, | |
98 | + " then indent one level beyond the bracket's first line. RE = an | |
99 | + " opening bracket followed by any amount of anything other than a | |
100 | + " closing bracket and then the end-of-line. If we didn't include the | |
101 | + " end of line, this RE would match even closed brackets, since it | |
102 | + " would match everything up to the closing bracket. | |
103 | + " This test isn't clever enough to handle brackets inside strings or | |
104 | + " comments. | |
105 | + if prev_line =~ '([^*][^)]*$' | |
106 | + let indnt = indnt + &shiftwidth | |
107 | + endif | |
108 | + | |
109 | + " If we just closed a bracket that started on a previous line, then | |
110 | + " unindent. | |
111 | + if prev_line =~ '^[^(]*[^*])' | |
112 | + let indnt = indnt - &shiftwidth | |
113 | + endif | |
114 | + | |
115 | + " At the end of a block, we have to unindent both the current line | |
116 | + " (the 'end;' for instance) and the newly-created line. | |
117 | + if this_line =~ '^\s*\(end;\|until\|else\)' | |
118 | + let indnt = indnt - &shiftwidth | |
119 | + endif | |
120 | + | |
121 | + " Keywords that always appear at the start of a line. | |
122 | + " Problem is that function and procedure keywords should be indented | |
123 | + " if within a class declaration. | |
124 | + if this_line =~ '^\s*\<type\|uses\|$IFDEF\|$ENDIF\|procedure\|function\>' | |
125 | + let indnt = 0 | |
126 | + endif | |
127 | + if prev_line =~ '^\s*\<type\|uses\>' | |
128 | + let indnt = &shiftwidth | |
129 | + endif | |
130 | + | |
131 | + " Put conditional compile directives on first column. | |
132 | + if this_line =~ '^\s*{\$' | |
133 | + let indnt = 0 | |
134 | + endif | |
135 | + | |
136 | + return indnt | |
137 | +endfunction | |
138 | + | |
139 | +" TODO: end; should align with the previous (begin/record/object/else). | |
140 | +" "else begin" is the only case where begin does not appear at the start | |
141 | +" of the line. | |
142 | + | |
143 | +" TODO: Don't align with {$IFDEF} | |
144 | + | |
145 | +"Example from vb.vim | |
146 | +" regular expression match, case insensitive | |
147 | +"if previous_line =~? | |
148 | +" start of line, zero or more whitespace | |
149 | +"'^\s* | |
150 | +" start of word | |
151 | +"\< | |
152 | +" | |
153 | +"\( | |
154 | +" begin\| | |
155 | +" \%( | |
156 | +" \%( | |
157 | +" private\|public\|friend | |
158 | +" \) | |
159 | +" \s\+ | |
160 | +" \) | |
161 | +" zero or more of the previous atom | |
162 | +" \= | |
163 | +" \%( | |
164 | +" function\|sub\|property | |
165 | +" \) | |
166 | +" \|select\|case\|default\|if | |
167 | +"\> | |
168 | +" .\{-}\<then\>\s*$\|else\|elseif\|do\|for\|while\|enum\|with | |
169 | +"\) | |
170 | +" end of word | |
171 | +"\>' | |
172 | +" let ind = ind + &sw | |
173 | +"endif |
@@ -7931,7 +7931,7 @@ | ||
7931 | 7931 | } |
7932 | 7932 | |
7933 | 7933 | /* |
7934 | - * return 0 for not writable, 1 for writable file, 2 for a dir which we have | |
7934 | + * Return 0 for not writable, 1 for writable file, 2 for a dir which we have | |
7935 | 7935 | * rights to write into. |
7936 | 7936 | */ |
7937 | 7937 | static void |
@@ -7939,34 +7939,7 @@ | ||
7939 | 7939 | typval_T *argvars; |
7940 | 7940 | typval_T *rettv; |
7941 | 7941 | { |
7942 | - char_u *p; | |
7943 | - int retval = 0; | |
7944 | -#if defined(UNIX) || defined(VMS) | |
7945 | - int perm = 0; | |
7946 | -#endif | |
7947 | - | |
7948 | - p = get_tv_string(&argvars[0]); | |
7949 | -#if defined(UNIX) || defined(VMS) | |
7950 | - perm = mch_getperm(p); | |
7951 | -#endif | |
7952 | -#ifndef MACOS_CLASSIC /* TODO: get either mch_writable or mch_access */ | |
7953 | - if ( | |
7954 | -# ifdef WIN3264 | |
7955 | - mch_writable(p) && | |
7956 | -# else | |
7957 | -# if defined(UNIX) || defined(VMS) | |
7958 | - (perm & 0222) && | |
7959 | -# endif | |
7960 | -# endif | |
7961 | - mch_access((char *)p, W_OK) == 0 | |
7962 | - ) | |
7963 | -#endif | |
7964 | - { | |
7965 | - ++retval; | |
7966 | - if (mch_isdir(p)) | |
7967 | - ++retval; | |
7968 | - } | |
7969 | - rettv->vval.v_number = retval; | |
7942 | + rettv->vval.v_number = filewritable(get_tv_string(&argvars[0])); | |
7970 | 7943 | } |
7971 | 7944 | |
7972 | 7945 | static void findfilendir __ARGS((typval_T *argvars, typval_T *rettv, int dir)); |
@@ -9492,6 +9465,9 @@ | ||
9492 | 9465 | "netbeans_intg", |
9493 | 9466 | #endif |
9494 | 9467 | #ifdef FEAT_SYN_HL |
9468 | + "spell", | |
9469 | +#endif | |
9470 | +#ifdef FEAT_SYN_HL | |
9495 | 9471 | "syntax", |
9496 | 9472 | #endif |
9497 | 9473 | #if defined(USE_SYSTEM) || !defined(UNIX) |
@@ -2433,7 +2433,7 @@ | ||
2433 | 2433 | { |
2434 | 2434 | /* Overwriting a file that is loaded in another buffer is not a |
2435 | 2435 | * good idea. */ |
2436 | - EMSG(_("E139: File is loaded in another buffer")); | |
2436 | + EMSG(_(e_bufloaded)); | |
2437 | 2437 | goto theend; |
2438 | 2438 | } |
2439 | 2439 | } |
@@ -2591,7 +2591,7 @@ | ||
2591 | 2591 | { |
2592 | 2592 | char_u buff[IOSIZE]; |
2593 | 2593 | |
2594 | - dialog_msg(buff, _("Overwrite existing file \"%.*s\"?"), fname); | |
2594 | + dialog_msg(buff, _("Overwrite existing file \"%s\"?"), fname); | |
2595 | 2595 | if (vim_dialog_yesno(VIM_QUESTION, NULL, buff, 2) != VIM_YES) |
2596 | 2596 | return FAIL; |
2597 | 2597 | eap->forceit = TRUE; |
@@ -2721,7 +2721,7 @@ | ||
2721 | 2721 | { |
2722 | 2722 | char_u buff[IOSIZE]; |
2723 | 2723 | |
2724 | - dialog_msg(buff, _("'readonly' option is set for \"%.*s\".\nDo you wish to write anyway?"), | |
2724 | + dialog_msg(buff, _("'readonly' option is set for \"%s\".\nDo you wish to write anyway?"), | |
2725 | 2725 | buf->b_fname); |
2726 | 2726 | |
2727 | 2727 | if (vim_dialog_yesno(VIM_QUESTION, NULL, buff, 2) == VIM_YES) |
@@ -757,6 +757,10 @@ | ||
757 | 757 | RANGE|DFLALL|WHOLEFOLD|BANG|EXTRA|NOTRLCOM|MODIFY), |
758 | 758 | EX(CMD_split, "split", ex_splitview, |
759 | 759 | BANG|FILE1|RANGE|NOTADR|EDITCMD|ARGOPT|TRLBAR), |
760 | +EX(CMD_spellgood, "spellgood", ex_spell, | |
761 | + NEEDARG|EXTRA|TRLBAR), | |
762 | +EX(CMD_spellwrong, "spellwrong", ex_spell, | |
763 | + NEEDARG|EXTRA|TRLBAR), | |
760 | 764 | EX(CMD_sprevious, "sprevious", ex_previous, |
761 | 765 | EXTRA|RANGE|NOTADR|COUNT|BANG|EDITCMD|ARGOPT|TRLBAR), |
762 | 766 | EX(CMD_srewind, "srewind", ex_rewind, |
@@ -92,4 +92,5 @@ | ||
92 | 92 | void sort_strings __ARGS((char_u **files, int count)); |
93 | 93 | int pathcmp __ARGS((const char *p, const char *q, int maxlen)); |
94 | 94 | char_u *parse_list_options __ARGS((char_u *option_str, option_table_T *table, int table_size)); |
95 | +int filewritable __ARGS((char_u *fname)); | |
95 | 96 | /* vim: set ft=c : */ |