• R/O
  • SSH

vim: 提交

Mirror of the Vim source from https://github.com/vim/vim


Commit MetaInfo

修訂a0451524244d6387ea49cfda296f6550a2a9aebd (tree)
時間2005-06-08 06:12:49
作者vimboss
Commitervimboss

Log Message

updated for version 7.0082

Change Summary

差異

diff -r 529f887b5cb7 -r a0451524244d runtime/doc/todo.txt
--- a/runtime/doc/todo.txt Tue Jun 07 21:09:25 2005 +0000
+++ b/runtime/doc/todo.txt Tue Jun 07 21:12:49 2005 +0000
@@ -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
22
33
44 VIM REFERENCE MANUAL by Bram Moolenaar
@@ -30,9 +30,6 @@
3030 *known-bugs*
3131 -------------------- Known bugs and current work -----------------------
3232
33-Patch in if_cscope.c also in 6.3? (Froloff)
34- Sergey says it's OK.
35-
3633 Add extra list of file locations. Can be used with:
3734 :ltag list of matching tags, like :tselect
3835
@@ -95,21 +92,10 @@
9592
9693 - Add SPELLCHECKER, with support for many languages.
9794 - 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.
10195 - 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'.
10596 - Is "-" to be considered a word character? "last-minute".
10697 No, in Dutch it can be added optionally. Then make English
10798 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
11399 - Implement compound words?
114100 - When @Spell and @NoSpell are both used only do spell checking for
115101 @Spell items, not where they both appear. Useful for Perl pod.
@@ -125,11 +111,8 @@
125111 author: Kevin Hendricks <kevin.hendricks@sympatico.ca>
126112 - More complicated: Regions with different languages? E.g. comments in
127113 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'.
133116 - Distribution: Need wordlists for many languages; "language pack"
134117 Put them on the ftp site, ready to download. Include README for
135118 copyrights.
@@ -143,7 +126,8 @@
143126 cluster" but change the contains list directly for matching syntax
144127 items.
145128 - 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).
147131
148132 - REFACTORING: The main() function is very long. Move parts to separate
149133 functions, especially loops. Ideas from Walter Briscoe (2003 Apr 3, 2004
diff -r 529f887b5cb7 -r a0451524244d runtime/doc/version7.txt
--- a/runtime/doc/version7.txt Tue Jun 07 21:09:25 2005 +0000
+++ b/runtime/doc/version7.txt Tue Jun 07 21:12:49 2005 +0000
@@ -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
22
33
44 VIM REFERENCE MANUAL by Bram Moolenaar
@@ -428,6 +428,8 @@
428428
429429 Sive syntax file. (Nikolai Weibull)
430430
431+Pascal indent file. (Neil Carter)
432+
431433 Moved all the indent settings from the filetype plugin to the indent file.
432434 Implemented b:undo_indent to undo indent settings when setting 'filetype' to a
433435 different value.
diff -r 529f887b5cb7 -r a0451524244d runtime/indent/pascal.vim
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/runtime/indent/pascal.vim Tue Jun 07 21:12:49 2005 +0000
@@ -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
diff -r 529f887b5cb7 -r a0451524244d src/eval.c
--- a/src/eval.c Tue Jun 07 21:09:25 2005 +0000
+++ b/src/eval.c Tue Jun 07 21:12:49 2005 +0000
@@ -7931,7 +7931,7 @@
79317931 }
79327932
79337933 /*
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
79357935 * rights to write into.
79367936 */
79377937 static void
@@ -7939,34 +7939,7 @@
79397939 typval_T *argvars;
79407940 typval_T *rettv;
79417941 {
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]));
79707943 }
79717944
79727945 static void findfilendir __ARGS((typval_T *argvars, typval_T *rettv, int dir));
@@ -9492,6 +9465,9 @@
94929465 "netbeans_intg",
94939466 #endif
94949467 #ifdef FEAT_SYN_HL
9468+ "spell",
9469+#endif
9470+#ifdef FEAT_SYN_HL
94959471 "syntax",
94969472 #endif
94979473 #if defined(USE_SYSTEM) || !defined(UNIX)
diff -r 529f887b5cb7 -r a0451524244d src/ex_cmds.c
--- a/src/ex_cmds.c Tue Jun 07 21:09:25 2005 +0000
+++ b/src/ex_cmds.c Tue Jun 07 21:12:49 2005 +0000
@@ -2433,7 +2433,7 @@
24332433 {
24342434 /* Overwriting a file that is loaded in another buffer is not a
24352435 * good idea. */
2436- EMSG(_("E139: File is loaded in another buffer"));
2436+ EMSG(_(e_bufloaded));
24372437 goto theend;
24382438 }
24392439 }
@@ -2591,7 +2591,7 @@
25912591 {
25922592 char_u buff[IOSIZE];
25932593
2594- dialog_msg(buff, _("Overwrite existing file \"%.*s\"?"), fname);
2594+ dialog_msg(buff, _("Overwrite existing file \"%s\"?"), fname);
25952595 if (vim_dialog_yesno(VIM_QUESTION, NULL, buff, 2) != VIM_YES)
25962596 return FAIL;
25972597 eap->forceit = TRUE;
@@ -2721,7 +2721,7 @@
27212721 {
27222722 char_u buff[IOSIZE];
27232723
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?"),
27252725 buf->b_fname);
27262726
27272727 if (vim_dialog_yesno(VIM_QUESTION, NULL, buff, 2) == VIM_YES)
diff -r 529f887b5cb7 -r a0451524244d src/ex_cmds.h
--- a/src/ex_cmds.h Tue Jun 07 21:09:25 2005 +0000
+++ b/src/ex_cmds.h Tue Jun 07 21:12:49 2005 +0000
@@ -757,6 +757,10 @@
757757 RANGE|DFLALL|WHOLEFOLD|BANG|EXTRA|NOTRLCOM|MODIFY),
758758 EX(CMD_split, "split", ex_splitview,
759759 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),
760764 EX(CMD_sprevious, "sprevious", ex_previous,
761765 EXTRA|RANGE|NOTADR|COUNT|BANG|EDITCMD|ARGOPT|TRLBAR),
762766 EX(CMD_srewind, "srewind", ex_rewind,
diff -r 529f887b5cb7 -r a0451524244d src/proto/misc2.pro
--- a/src/proto/misc2.pro Tue Jun 07 21:09:25 2005 +0000
+++ b/src/proto/misc2.pro Tue Jun 07 21:12:49 2005 +0000
@@ -92,4 +92,5 @@
9292 void sort_strings __ARGS((char_u **files, int count));
9393 int pathcmp __ARGS((const char *p, const char *q, int maxlen));
9494 char_u *parse_list_options __ARGS((char_u *option_str, option_table_T *table, int table_size));
95+int filewritable __ARGS((char_u *fname));
9596 /* vim: set ft=c : */
Show on old repository browser