Mirror of the Vim source from https://github.com/vim/vim
リビジョン | 732c7ae5743ec2d22423a8bb631e2d3c5fb8e549 (tree) |
---|---|
日時 | 2006-01-14 07:35:40 |
作者 | vimboss |
コミッター | vimboss |
updated for version 7.0180
@@ -0,0 +1,216 @@ | ||
1 | +"pycomplete.vim - Omni Completion for python | |
2 | +" Maintainer: Aaron Griffin | |
3 | +" Version: 0.2 | |
4 | +" Last Updated: 5 January 2006 | |
5 | +" | |
6 | +" TODO | |
7 | +" * local variables *inside* class members | |
8 | + | |
9 | +if !has('python') | |
10 | + echo "Error: Required vim compiled with +python" | |
11 | + finish | |
12 | +endif | |
13 | + | |
14 | +function! pycomplete#Complete(findstart, base) | |
15 | + "findstart = 1 when we need to get the text length | |
16 | + if a:findstart | |
17 | + let line = getline('.') | |
18 | + let idx = col('.') | |
19 | + while idx > 0 | |
20 | + let idx -= 1 | |
21 | + let c = line[idx-1] | |
22 | + if c =~ '\w' | |
23 | + continue | |
24 | + elseif ! c =~ '\.' | |
25 | + idx = -1 | |
26 | + break | |
27 | + else | |
28 | + break | |
29 | + endif | |
30 | + endwhile | |
31 | + | |
32 | + return idx | |
33 | + "findstart = 0 when we need to return the list of completions | |
34 | + else | |
35 | + execute "python get_completions('" . a:base . "')" | |
36 | + return g:pycomplete_completions | |
37 | + endif | |
38 | +endfunction | |
39 | + | |
40 | +function! s:DefPython() | |
41 | +python << PYTHONEOF | |
42 | +import vim | |
43 | +import sys | |
44 | +import __builtin__ | |
45 | + | |
46 | +LOCALDEFS = \ | |
47 | + ['LOCALDEFS', 'clean_up','eval_source_code', \ | |
48 | + 'get_completions', '__builtin__', '__builtins__', \ | |
49 | + 'dbg', '__name__', 'vim', 'sys'] | |
50 | +#comment/uncomment one line at a time to enable/disable debugging | |
51 | +def dbg(msg): | |
52 | + pass | |
53 | +# print(msg) | |
54 | + | |
55 | +#it seems that by this point, vim has already stripped the base | |
56 | +# matched in the findstart=1 section, so we will create the | |
57 | +# statement from scratch | |
58 | +def get_completions(base): | |
59 | + stmt = vim.eval('expand("<cWORD>")')+base | |
60 | + dbg("parsed statement => %s" % stmt) | |
61 | + eval_source_code() | |
62 | + try: | |
63 | + dbg("eval: %s" % stmt) | |
64 | + if len(stmt.split('.')) == 1: | |
65 | + all = globals().keys() + dir(__builtin__) | |
66 | + match = stmt | |
67 | + else: | |
68 | + rindex= stmt.rfind('.') | |
69 | + all = dir(eval(stmt[:rindex])) | |
70 | + match = stmt[rindex+1:] | |
71 | + | |
72 | + completions = [] | |
73 | + dbg("match == %s" % match) | |
74 | + for m in all: | |
75 | + #TODO: remove private (_foo) functions? | |
76 | + if m.find('__') != 0 and \ | |
77 | + m.find(match) == 0 and \ | |
78 | + m not in LOCALDEFS: | |
79 | + dbg("matched... %s, %s" % (m, m.find(match))) | |
80 | + completions.append(m) | |
81 | + dbg("all completions: %s" % completions) | |
82 | + vim.command("let g:pycomplete_completions = %s" % completions) | |
83 | + except: | |
84 | + dbg("exception: %s" % sys.exc_info()[1]) | |
85 | + vim.command("let g:pycomplete_completions = []") | |
86 | + clean_up() | |
87 | + | |
88 | +#yes, this is a quasi-functional python lexer | |
89 | +def eval_source_code(): | |
90 | + import tokenize | |
91 | + import keyword | |
92 | + import StringIO | |
93 | + s = StringIO.StringIO('\n'.join(vim.current.buffer[:]) + '\n') | |
94 | + g = tokenize.generate_tokens(s.readline) | |
95 | + | |
96 | + stmts = [] | |
97 | + lineNo = 0 | |
98 | + try: | |
99 | + for type, str, begin, end, line in g: | |
100 | + if begin[0] == lineNo: | |
101 | + continue | |
102 | + #junk | |
103 | + elif type == tokenize.INDENT or \ | |
104 | + type == tokenize.DEDENT or \ | |
105 | + type == tokenize.ERRORTOKEN or \ | |
106 | + type == tokenize.ENDMARKER or \ | |
107 | + type == tokenize.NEWLINE: | |
108 | + continue | |
109 | + #import statement | |
110 | + elif str == 'import': | |
111 | + for type, str, begin, end, line in g: | |
112 | + if str == ';' or type == tokenize.NEWLINE: break | |
113 | + dbg("found [import %s]" % str) | |
114 | + stmts.append("import %s" % str) | |
115 | + #import from statement | |
116 | + elif str == 'from': | |
117 | + type, str, begin, end, line = g.next() | |
118 | + mod = str | |
119 | + | |
120 | + type, str, begin, end, line = g.next() | |
121 | + if str != "import": break | |
122 | + mem = '' | |
123 | + for type, str, begin, end, line in g: | |
124 | + if str == ';' or type == tokenize.NEWLINE: break | |
125 | + mem += (str + ',') | |
126 | + if len(mem) > 0: | |
127 | + dbg("found [from %s import %s]" % (mod, mem[:-1])) | |
128 | + stmts.append("from %s import %s" % (mod, mem[:-1])) | |
129 | + #class declaration | |
130 | + elif str == 'class': | |
131 | + type, str, begin, end, line = g.next() | |
132 | + classname = str | |
133 | + dbg("found [class %s]" % classname) | |
134 | + | |
135 | + level = 0 | |
136 | + members = [] | |
137 | + #we don't care about the meat of the members, | |
138 | + # only the signatures, so we'll replace the bodies | |
139 | + # with 'pass' for evaluation | |
140 | + for type, str, begin, end, line in g: | |
141 | + if type == tokenize.INDENT: | |
142 | + level += 1 | |
143 | + elif type == tokenize.DEDENT: | |
144 | + level -= 1 | |
145 | + if level == 0: break; | |
146 | + elif str == 'def': | |
147 | + #TODO: if name begins with '_', keep private | |
148 | + memberstr = '' | |
149 | + for type, str, begin, end, line in g: | |
150 | + if str == ':': break | |
151 | + memberstr += str | |
152 | + dbg(" member [%s]" % memberstr) | |
153 | + members.append(memberstr) | |
154 | + #TODO parse self.blah = something lines | |
155 | + #elif str == "self" && next && str == "." ...blah... | |
156 | + classstr = 'class %s:' % classname | |
157 | + for m in members: | |
158 | + classstr += ("\n def %s:\n pass" % m) | |
159 | + stmts.append("%s\n" % classstr) | |
160 | + elif keyword.iskeyword(str) or str in globals(): | |
161 | + dbg("keyword = %s" % str) | |
162 | + lineNo = begin[0] | |
163 | + else: | |
164 | + if line.find("=") == -1: continue | |
165 | + var = str | |
166 | + type, str, begin, end, line = g.next() | |
167 | + dbg('next = %s' % str) | |
168 | + if str != '=': continue | |
169 | + | |
170 | + type, str, begin, end, line = g.next() | |
171 | + if type == tokenize.NEWLINE: | |
172 | + continue | |
173 | + elif type == tokenize.STRING or str == 'str': | |
174 | + stmts.append('%s = str' % var) | |
175 | + elif str == '[' or str == 'list': | |
176 | + stmts.append('%s= list' % var) | |
177 | + elif str == '{' or str == 'dict': | |
178 | + stmts.append('%s = dict' % var) | |
179 | + elif type == tokenize.NUMBER: | |
180 | + continue | |
181 | + elif str == 'Set': | |
182 | + stmts.append('%s = Set' % var) | |
183 | + elif str == 'open' or str == 'file': | |
184 | + stmts.append('%s = file' % var) | |
185 | + else: | |
186 | + inst = str | |
187 | + for type, str, begin, end, line in g: | |
188 | + if type == tokenize.NEWLINE: | |
189 | + break | |
190 | + inst += str | |
191 | + if len(inst) > 0: | |
192 | + dbg("found [%s = %s]" % (var, inst)) | |
193 | + stmts.append('%s = %s' % (var, inst)) | |
194 | + lineNo = begin[0] | |
195 | + for s in stmts: | |
196 | + try: | |
197 | + dbg("evaluating: %s\n" % s) | |
198 | + exec(s) in globals() | |
199 | + except: | |
200 | + pass | |
201 | + except: | |
202 | + dbg("exception: %s" % sys.exc_info()[1]) | |
203 | + | |
204 | +def clean_up(): | |
205 | + for o in globals().keys(): | |
206 | + if o not in LOCALDEFS: | |
207 | + try: | |
208 | + exec('del %s' % o) in globals() | |
209 | + except: pass | |
210 | + | |
211 | +sys.path.extend(['.','..']) | |
212 | +PYTHONEOF | |
213 | +endfunction | |
214 | + | |
215 | +call s:DefPython() | |
216 | +" vim: set et ts=4: |
@@ -1,4 +1,4 @@ | ||
1 | -*eval.txt* For Vim version 7.0aa. Last change: 2006 Jan 09 | |
1 | +*eval.txt* For Vim version 7.0aa. Last change: 2006 Jan 13 | |
2 | 2 | |
3 | 3 | |
4 | 4 | VIM REFERENCE MANUAL by Bram Moolenaar |
@@ -3273,6 +3273,10 @@ | ||
3273 | 3273 | translated like in the output of the ":map" command listing. |
3274 | 3274 | The mappings local to the current buffer are checked first, |
3275 | 3275 | then the global mappings. |
3276 | + This function can be used to map a key even when it's already | |
3277 | + mapped, and have it do the original mapping too. Sketch: > | |
3278 | + exe 'nnoremap <Tab> ==' . maparg('<Tab>', 'n') | |
3279 | + | |
3276 | 3280 | |
3277 | 3281 | mapcheck({name}[, {mode}]) *mapcheck()* |
3278 | 3282 | Check if there is a mapping that matches with {name} in mode |
@@ -1,4 +1,4 @@ | ||
1 | -*map.txt* For Vim version 7.0aa. Last change: 2006 Jan 09 | |
1 | +*map.txt* For Vim version 7.0aa. Last change: 2006 Jan 13 | |
2 | 2 | |
3 | 3 | |
4 | 4 | VIM REFERENCE MANUAL by Bram Moolenaar |
@@ -191,6 +191,8 @@ | ||
191 | 191 | Example of what will fail: > |
192 | 192 | :map ,w /[#&!]<CR> |
193 | 193 | :map <buffer> <unique> ,w /[.,;]<CR> |
194 | +If you want to map a key and then have it do what it was originally mapped to, | |
195 | +have a look at |maparg()|. | |
194 | 196 | |
195 | 197 | "<buffer>", "<silent>", "<script>" and "<unique>" can be used in any order. |
196 | 198 | They must appear right after the command, before any other arguments. |
@@ -639,7 +641,7 @@ | ||
639 | 641 | invoke the |g@| operator. After the user types the {motion} command the |
640 | 642 | specified function will be called. |
641 | 643 | |
642 | - *g@* | |
644 | + *g@* *E774* *E775* | |
643 | 645 | g@{motion} Call the function set by the 'operatorfunc' option. |
644 | 646 | The '[ mark is positioned at the start of the text |
645 | 647 | moved over by {motion}, the '] mark on the last |
@@ -1,4 +1,4 @@ | ||
1 | -*quickfix.txt* For Vim version 7.0aa. Last change: 2006 Jan 11 | |
1 | +*quickfix.txt* For Vim version 7.0aa. Last change: 2006 Jan 13 | |
2 | 2 | |
3 | 3 | |
4 | 4 | VIM REFERENCE MANUAL by Bram Moolenaar |
@@ -123,7 +123,7 @@ | ||
123 | 123 | A range can be specified for the lines to be used. |
124 | 124 | Otherwise all lines in the buffer are used. |
125 | 125 | |
126 | - *:cex* *:cexpr* | |
126 | + *:cex* *:cexpr* *E777* | |
127 | 127 | :cex[pr][!] {expr} Create a quickfix list using the result of {expr} and |
128 | 128 | jump to the first error. If {expr} is a String, then |
129 | 129 | each new-line terminated line in the String is |
@@ -1,4 +1,4 @@ | ||
1 | -*spell.txt* For Vim version 7.0aa. Last change: 2006 Jan 11 | |
1 | +*spell.txt* For Vim version 7.0aa. Last change: 2006 Jan 13 | |
2 | 2 | |
3 | 3 | |
4 | 4 | VIM REFERENCE MANUAL by Bram Moolenaar |
@@ -302,12 +302,12 @@ | ||
302 | 302 | |spell-mkspell| about how to create a spell file. Converting a spell file |
303 | 303 | with "iconv" will NOT work! |
304 | 304 | |
305 | - *spell-sug-file* | |
305 | + *spell-sug-file* *E781* | |
306 | 306 | If there is a file with exactly the same name as the ".spl" file but ending in |
307 | 307 | ".sug", that file will be used for giving better suggestions. It isn't loaded |
308 | 308 | before suggestions are made to reduce memory use. |
309 | 309 | |
310 | - *E758* *E759* | |
310 | + *E758* *E759* *E778* *E779* *E780* *E782* | |
311 | 311 | When loading a spell file Vim checks that it is properly formatted. If you |
312 | 312 | get an error the file may be truncated, modified or intended for another Vim |
313 | 313 | version. |
@@ -1299,7 +1299,7 @@ | ||
1299 | 1299 | REP the_the the ~ |
1300 | 1300 | |
1301 | 1301 | |
1302 | -SIMILAR CHARACTERS *spell-MAP* | |
1302 | +SIMILAR CHARACTERS *spell-MAP* *E783* | |
1303 | 1303 | |
1304 | 1304 | In the affix file MAP items can be used to define letters that are very much |
1305 | 1305 | alike. This is mostly used for a letter with different accents. This is used |
@@ -1089,6 +1089,7 @@ | ||
1089 | 1089 | +multi_byte_ime various.txt /*+multi_byte_ime* |
1090 | 1090 | +multi_lang various.txt /*+multi_lang* |
1091 | 1091 | +mzscheme various.txt /*+mzscheme* |
1092 | ++mzscheme/dyn various.txt /*+mzscheme\/dyn* | |
1092 | 1093 | +netbeans_intg various.txt /*+netbeans_intg* |
1093 | 1094 | +ole various.txt /*+ole* |
1094 | 1095 | +osfiletype various.txt /*+osfiletype* |
@@ -1782,7 +1783,7 @@ | ||
1782 | 1783 | :cabbrev map.txt /*:cabbrev* |
1783 | 1784 | :cabc map.txt /*:cabc* |
1784 | 1785 | :cabclear map.txt /*:cabclear* |
1785 | -:cadde quickfix.txt /*:cadde* | |
1786 | +:cad quickfix.txt /*:cad* | |
1786 | 1787 | :caddexpr quickfix.txt /*:caddexpr* |
1787 | 1788 | :caddf quickfix.txt /*:caddf* |
1788 | 1789 | :caddfile quickfix.txt /*:caddfile* |
@@ -3791,7 +3792,16 @@ | ||
3791 | 3792 | E771 spell.txt /*E771* |
3792 | 3793 | E772 spell.txt /*E772* |
3793 | 3794 | E773 recover.txt /*E773* |
3795 | +E774 map.txt /*E774* | |
3796 | +E775 map.txt /*E775* | |
3797 | +E777 quickfix.txt /*E777* | |
3798 | +E778 spell.txt /*E778* | |
3799 | +E779 spell.txt /*E779* | |
3794 | 3800 | E78 motion.txt /*E78* |
3801 | +E780 spell.txt /*E780* | |
3802 | +E781 spell.txt /*E781* | |
3803 | +E782 spell.txt /*E782* | |
3804 | +E783 spell.txt /*E783* | |
3795 | 3805 | E79 message.txt /*E79* |
3796 | 3806 | E80 message.txt /*E80* |
3797 | 3807 | E800 arabic.txt /*E800* |
@@ -4683,6 +4693,7 @@ | ||
4683 | 4693 | design-speed-size develop.txt /*design-speed-size* |
4684 | 4694 | desktop.vim syntax.txt /*desktop.vim* |
4685 | 4695 | develop-spell develop.txt /*develop-spell* |
4696 | +develop-spell-suggestions develop.txt /*develop-spell-suggestions* | |
4686 | 4697 | develop.txt develop.txt /*develop.txt* |
4687 | 4698 | development develop.txt /*development* |
4688 | 4699 | dh change.txt /*dh* |
@@ -5081,6 +5092,7 @@ | ||
5081 | 5092 | ft-spup-syntax syntax.txt /*ft-spup-syntax* |
5082 | 5093 | ft-sql-syntax syntax.txt /*ft-sql-syntax* |
5083 | 5094 | ft-sqlinformix-syntax syntax.txt /*ft-sqlinformix-syntax* |
5095 | +ft-syntax-omni insert.txt /*ft-syntax-omni* | |
5084 | 5096 | ft-tcsh-syntax syntax.txt /*ft-tcsh-syntax* |
5085 | 5097 | ft-termcap-syntax syntax.txt /*ft-termcap-syntax* |
5086 | 5098 | ft-tex-syntax syntax.txt /*ft-tex-syntax* |
@@ -5860,6 +5872,7 @@ | ||
5860 | 5872 | mzscheme if_mzsch.txt /*mzscheme* |
5861 | 5873 | mzscheme-buffer if_mzsch.txt /*mzscheme-buffer* |
5862 | 5874 | mzscheme-commands if_mzsch.txt /*mzscheme-commands* |
5875 | +mzscheme-dynamic if_mzsch.txt /*mzscheme-dynamic* | |
5863 | 5876 | mzscheme-examples if_mzsch.txt /*mzscheme-examples* |
5864 | 5877 | mzscheme-sandbox if_mzsch.txt /*mzscheme-sandbox* |
5865 | 5878 | mzscheme-threads if_mzsch.txt /*mzscheme-threads* |
@@ -6174,6 +6187,7 @@ | ||
6174 | 6187 | popt-option print.txt /*popt-option* |
6175 | 6188 | popup-menu gui.txt /*popup-menu* |
6176 | 6189 | popup-menu-added version5.txt /*popup-menu-added* |
6190 | +popupmenu-completion insert.txt /*popupmenu-completion* | |
6177 | 6191 | ports-5.2 version5.txt /*ports-5.2* |
6178 | 6192 | ports-6 version6.txt /*ports-6* |
6179 | 6193 | posix vi_diff.txt /*posix* |
@@ -6482,35 +6496,73 @@ | ||
6482 | 6496 | special-buffers windows.txt /*special-buffers* |
6483 | 6497 | speed-up tips.txt /*speed-up* |
6484 | 6498 | spell spell.txt /*spell* |
6499 | +spell-ACCENT spell.txt /*spell-ACCENT* | |
6485 | 6500 | spell-BAD spell.txt /*spell-BAD* |
6501 | +spell-CHECKCOMPOUNDCASE spell.txt /*spell-CHECKCOMPOUNDCASE* | |
6502 | +spell-CHECKCOMPOUNDDUP spell.txt /*spell-CHECKCOMPOUNDDUP* | |
6503 | +spell-CHECKCOMPOUNDPATTERN spell.txt /*spell-CHECKCOMPOUNDPATTERN* | |
6504 | +spell-CHECKCOMPOUNDREP spell.txt /*spell-CHECKCOMPOUNDREP* | |
6505 | +spell-CHECKCOMPOUNDTRIPLE spell.txt /*spell-CHECKCOMPOUNDTRIPLE* | |
6506 | +spell-CIRCUMFIX spell.txt /*spell-CIRCUMFIX* | |
6486 | 6507 | spell-CMP spell.txt /*spell-CMP* |
6508 | +spell-COMMON spell.txt /*spell-COMMON* | |
6509 | +spell-COMPLEXPREFIXES spell.txt /*spell-COMPLEXPREFIXES* | |
6510 | +spell-COMPOUNDBEGIN spell.txt /*spell-COMPOUNDBEGIN* | |
6511 | +spell-COMPOUNDEND spell.txt /*spell-COMPOUNDEND* | |
6487 | 6512 | spell-COMPOUNDFLAG spell.txt /*spell-COMPOUNDFLAG* |
6488 | 6513 | spell-COMPOUNDFLAGS spell.txt /*spell-COMPOUNDFLAGS* |
6514 | +spell-COMPOUNDFORBIDFLAG spell.txt /*spell-COMPOUNDFORBIDFLAG* | |
6489 | 6515 | spell-COMPOUNDMAX spell.txt /*spell-COMPOUNDMAX* |
6516 | +spell-COMPOUNDMIDDLE spell.txt /*spell-COMPOUNDMIDDLE* | |
6490 | 6517 | spell-COMPOUNDMIN spell.txt /*spell-COMPOUNDMIN* |
6518 | +spell-COMPOUNDPERMITFLAG spell.txt /*spell-COMPOUNDPERMITFLAG* | |
6519 | +spell-COMPOUNDROOT spell.txt /*spell-COMPOUNDROOT* | |
6520 | +spell-COMPOUNDSYLLABLE spell.txt /*spell-COMPOUNDSYLLABLE* | |
6491 | 6521 | spell-COMPOUNDSYLMAX spell.txt /*spell-COMPOUNDSYLMAX* |
6522 | +spell-COMPOUNDWORDMAX spell.txt /*spell-COMPOUNDWORDMAX* | |
6492 | 6523 | spell-FLAG spell.txt /*spell-FLAG* |
6493 | 6524 | spell-FOL spell.txt /*spell-FOL* |
6494 | -spell-KEP spell.txt /*spell-KEP* | |
6525 | +spell-FORBIDDENWORD spell.txt /*spell-FORBIDDENWORD* | |
6526 | +spell-HOME spell.txt /*spell-HOME* | |
6527 | +spell-KEEPCASE spell.txt /*spell-KEEPCASE* | |
6528 | +spell-LANG spell.txt /*spell-LANG* | |
6529 | +spell-LEMMA_PRESENT spell.txt /*spell-LEMMA_PRESENT* | |
6495 | 6530 | spell-LOW spell.txt /*spell-LOW* |
6496 | 6531 | spell-MAP spell.txt /*spell-MAP* |
6532 | +spell-MAXNGRAMSUGS spell.txt /*spell-MAXNGRAMSUGS* | |
6533 | +spell-NAME spell.txt /*spell-NAME* | |
6497 | 6534 | spell-NEEDAFFIX spell.txt /*spell-NEEDAFFIX* |
6498 | 6535 | spell-NEEDCOMPOUND spell.txt /*spell-NEEDCOMPOUND* |
6499 | 6536 | spell-NOBREAK spell.txt /*spell-NOBREAK* |
6537 | +spell-NOSPLITSUGS spell.txt /*spell-NOSPLITSUGS* | |
6538 | +spell-NOSUGFILE spell.txt /*spell-NOSUGFILE* | |
6539 | +spell-NOSUGGEST spell.txt /*spell-NOSUGGEST* | |
6540 | +spell-ONLYINCOMPOUND spell.txt /*spell-ONLYINCOMPOUND* | |
6500 | 6541 | spell-PFX spell.txt /*spell-PFX* |
6501 | 6542 | spell-PFXPOSTPONE spell.txt /*spell-PFXPOSTPONE* |
6502 | -spell-RAR spell.txt /*spell-RAR* | |
6543 | +spell-PSEUDOROOT spell.txt /*spell-PSEUDOROOT* | |
6544 | +spell-RARE spell.txt /*spell-RARE* | |
6503 | 6545 | spell-REP spell.txt /*spell-REP* |
6504 | 6546 | spell-SAL spell.txt /*spell-SAL* |
6547 | +spell-SET spell.txt /*spell-SET* | |
6505 | 6548 | spell-SFX spell.txt /*spell-SFX* |
6506 | 6549 | spell-SLASH spell.txt /*spell-SLASH* |
6507 | 6550 | spell-SOFOFROM spell.txt /*spell-SOFOFROM* |
6508 | 6551 | spell-SOFOTO spell.txt /*spell-SOFOTO* |
6552 | +spell-SUGSWITHDOTS spell.txt /*spell-SUGSWITHDOTS* | |
6509 | 6553 | spell-SYLLABLE spell.txt /*spell-SYLLABLE* |
6554 | +spell-SYLLABLENUM spell.txt /*spell-SYLLABLENUM* | |
6555 | +spell-TRY spell.txt /*spell-TRY* | |
6510 | 6556 | spell-UPP spell.txt /*spell-UPP* |
6557 | +spell-VERSION spell.txt /*spell-VERSION* | |
6558 | +spell-WORDCHARS spell.txt /*spell-WORDCHARS* | |
6559 | +spell-aff-format spell.txt /*spell-aff-format* | |
6511 | 6560 | spell-affix-chars spell.txt /*spell-affix-chars* |
6561 | +spell-affix-comment spell.txt /*spell-affix-comment* | |
6562 | +spell-affix-flags spell.txt /*spell-affix-flags* | |
6512 | 6563 | spell-affix-mbyte spell.txt /*spell-affix-mbyte* |
6513 | 6564 | spell-affix-nocomp spell.txt /*spell-affix-nocomp* |
6565 | +spell-affix-not-supported spell.txt /*spell-affix-not-supported* | |
6514 | 6566 | spell-affix-rare spell.txt /*spell-affix-rare* |
6515 | 6567 | spell-affix-vim spell.txt /*spell-affix-vim* |
6516 | 6568 | spell-compound spell.txt /*spell-compound* |
@@ -6524,6 +6576,7 @@ | ||
6524 | 6576 | spell-quickstart spell.txt /*spell-quickstart* |
6525 | 6577 | spell-remarks spell.txt /*spell-remarks* |
6526 | 6578 | spell-russian spell.txt /*spell-russian* |
6579 | +spell-sug-file spell.txt /*spell-sug-file* | |
6527 | 6580 | spell-syntax spell.txt /*spell-syntax* |
6528 | 6581 | spell-wordlist-format spell.txt /*spell-wordlist-format* |
6529 | 6582 | spell-yiddish spell.txt /*spell-yiddish* |
@@ -1,4 +1,4 @@ | ||
1 | -*todo.txt* For Vim version 7.0aa. Last change: 2006 Jan 12 | |
1 | +*todo.txt* For Vim version 7.0aa. Last change: 2006 Jan 13 | |
2 | 2 | |
3 | 3 | |
4 | 4 | VIM REFERENCE MANUAL by Bram Moolenaar |
@@ -30,18 +30,6 @@ | ||
30 | 30 | *known-bugs* |
31 | 31 | -------------------- Known bugs and current work ----------------------- |
32 | 32 | |
33 | -Find E999 and hand out numbers. | |
34 | - | |
35 | -Compress list of word numbers: sort them, computer differences, store as utf-8 | |
36 | -bytes. | |
37 | - | |
38 | -Undo bug: Gerald Lai Jan 3. | |
39 | - | |
40 | -Syntax HL: when region start has an offset that happens to be after the end of | |
41 | -the line then strange things happen. (Brett Stahlman Dec 31) | |
42 | - | |
43 | -Add Python complete script (Aaron Griffin) | |
44 | - | |
45 | 33 | Evaluating CTRL-R = in the sandbox causes trouble (G. Sumner Hayes). Can the |
46 | 34 | rules for the commandline window be used? |
47 | 35 |
@@ -64,6 +52,13 @@ | ||
64 | 52 | away. How to figure out if it's a pointer or not? |
65 | 53 | - When a typedef or struct is local to a file only use it in that file? |
66 | 54 | - Extra info for each entry to show in a tooltip kind of thing. |
55 | + Should use a dictionary for each entry. Fields could be: | |
56 | + word the completed word | |
57 | + menu menu text (use word when missing) | |
58 | + info extra info, to be displayed in balloon (e.g., function args) | |
59 | + kind single letter indicating the type of word: | |
60 | + v = variable, f = function/method, c = composite (object, | |
61 | + struct pointer). | |
67 | 62 | - Special mappings for when the popup menu is visible? Would allow for making |
68 | 63 | a specific selection (e.g, methods vs variables). |
69 | 64 | - Provide a function to popup the menu, so that an insert mode mapping can |
@@ -440,7 +435,7 @@ | ||
440 | 435 | Add extra list of file locations. A bit like the quickfix list, but there is |
441 | 436 | one per window. Can be used with: |
442 | 437 | :ltag list of matching tags, like :tselect |
443 | -Patch from Yegappan Lakshmanan, Jan 9. | |
438 | +Patch from Yegappan Lakshmanan, Jan 13. | |
444 | 439 | Commands to use the location list: |
445 | 440 | :lnext next location |
446 | 441 | :lprevious :lNext previous location |
@@ -1,4 +1,4 @@ | ||
1 | -*version7.txt* For Vim version 7.0aa. Last change: 2006 Jan 09 | |
1 | +*version7.txt* For Vim version 7.0aa. Last change: 2006 Jan 13 | |
2 | 2 | |
3 | 3 | |
4 | 4 | VIM REFERENCE MANUAL by Bram Moolenaar |
@@ -1545,4 +1545,17 @@ | ||
1545 | 1545 | When ":silent! {cmd}" caused the swap file dialog, which isn't displayed, |
1546 | 1546 | there would still be a hit-enter prompt. |
1547 | 1547 | |
1548 | +Requesting the termresponse (|t_RV|) early may cause problems with "-c" | |
1549 | +arguments that invoke an external command or even "-c quit". Postpone it | |
1550 | +until after executing "-c" arguments. | |
1551 | + | |
1552 | +When typing in Insert mode so that a new line is started, using CTRL-G u to | |
1553 | +break undo and start a new change, then joining the lines with <BS> caused | |
1554 | +undo info to be missing. Now reset the insertion start point. | |
1555 | + | |
1556 | +Syntax HL: When a region start match has a matchgroup and an offset that | |
1557 | +happens to be after the end of the line then it continued in the next line and | |
1558 | +stopped at the region end match, making the region continue after that. | |
1559 | +Now check for the column being past the end of the line in syn_add_end_off(). | |
1560 | + | |
1548 | 1561 | vim:tw=78:ts=8:ft=help:norl: |
@@ -0,0 +1,30 @@ | ||
1 | +" Vim filetype plugin file | |
2 | +" Language: matlab | |
3 | +" Maintainer: Jake Wasserman <jwasserman at gmail dot com> | |
4 | +" Last Changed: 2006 Jan 12 | |
5 | + | |
6 | +if exists("b:did_ftplugin") | |
7 | + finish | |
8 | +endif | |
9 | +let b:did_ftplugin = 1 | |
10 | + | |
11 | +let s:save_cpo = &cpo | |
12 | +set cpo-=C | |
13 | + | |
14 | +if exists("loaded_matchit") | |
15 | + let s:conditionalEnd = '\(([^()]*\)\@!\<end\>\([^()]*)\)\@!' | |
16 | + let b:match_words = '\<if\>\|\<while\>\|\<for\>\|\<switch\>:' . | |
17 | + \ s:conditionalEnd . ',\<if\>:\<elseif\>:\<else\>:' . | |
18 | + \ s:conditionalEnd | |
19 | +endif | |
20 | + | |
21 | +setlocal suffixesadd=.m | |
22 | +setlocal suffixes+=.asv | |
23 | + | |
24 | +let b:undo_ftplugin = "setlocal suffixesadd< suffixes< " | |
25 | + \ . "| unlet! b:match_words" | |
26 | + | |
27 | +let &cpo = s:save_cpo | |
28 | + | |
29 | + | |
30 | + |
@@ -14,6 +14,8 @@ | ||
14 | 14 | setlocal comments-=:% |
15 | 15 | setlocal commentstring=#%s |
16 | 16 | |
17 | +setlocal omnifunc=pycomplete#Complete | |
18 | + | |
17 | 19 | set wildignore+=*.pyc |
18 | 20 | |
19 | 21 | nnoremap <silent> <buffer> ]] :call <SID>Python_jump('/^\(class\\|def\)')<cr> |
@@ -541,7 +541,7 @@ | ||
541 | 541 | |
542 | 542 | # MEMORY LEAK DETECTION |
543 | 543 | # Requires installing the ccmalloc library. |
544 | -# Configuration is in the .ccmalloc file. | |
544 | +# Configuration is in the .ccmalloc or ~/.ccmalloc file. | |
545 | 545 | # Doesn't work very well, since memory linked to from global variables |
546 | 546 | # (indirectly) is also marked as leaked memory. |
547 | 547 | #PROFILE_CFLAGS = -DEXITFREE |
@@ -6527,6 +6527,10 @@ | ||
6527 | 6527 | /* CTRL-G u: start new undoable edit */ |
6528 | 6528 | case 'u': u_sync(); |
6529 | 6529 | ins_need_undo = TRUE; |
6530 | + | |
6531 | + /* Need to reset Insstart, esp. because a BS that joins | |
6532 | + * aline to the previous one must save for undo. */ | |
6533 | + Insstart = curwin->w_cursor; | |
6530 | 6534 | break; |
6531 | 6535 | |
6532 | 6536 | /* Unknown CTRL-G command, reserved for future expansion. */ |
@@ -844,6 +844,12 @@ | ||
844 | 844 | no_wait_return = FALSE; |
845 | 845 | starting = 0; |
846 | 846 | |
847 | +#ifdef FEAT_TERMRESPONSE | |
848 | + /* Requesting the termresponse is postponed until here, so that a "-c q" | |
849 | + * argument doesn't make it appear in the shell Vim was started from. */ | |
850 | + may_req_termresponse(); | |
851 | +#endif | |
852 | + | |
847 | 853 | /* start in insert mode */ |
848 | 854 | if (p_im) |
849 | 855 | need_start_insertmode = TRUE; |
@@ -2188,7 +2188,6 @@ | ||
2188 | 2188 | vim_free(last_msgchunk); |
2189 | 2189 | last_msgchunk = mp; |
2190 | 2190 | } |
2191 | - last_msgchunk = NULL; | |
2192 | 2191 | } |
2193 | 2192 | |
2194 | 2193 | /* |
@@ -3583,6 +3583,8 @@ | ||
3583 | 3583 | { |
3584 | 3584 | struct passwd *pw; |
3585 | 3585 | |
3586 | + /* Note: memory allocated by getpwnam() is never freed. | |
3587 | + * Calling endpwent() apparently doesn't help. */ | |
3586 | 3588 | pw = getpwnam((char *)dst + 1); |
3587 | 3589 | if (pw != NULL) |
3588 | 3590 | var = (char_u *)pw->pw_dir; |
@@ -1012,6 +1012,7 @@ | ||
1012 | 1012 | free_cd_dir(); |
1013 | 1013 | set_expr_line(NULL); |
1014 | 1014 | diff_clear(); |
1015 | + clear_sb_text(); /* free any scrollback text */ | |
1015 | 1016 | |
1016 | 1017 | /* Free some global vars. */ |
1017 | 1018 | vim_free(username); |
@@ -33,6 +33,7 @@ | ||
33 | 33 | void settmode __ARGS((int tmode)); |
34 | 34 | void starttermcap __ARGS((void)); |
35 | 35 | void stoptermcap __ARGS((void)); |
36 | +void may_req_termresponse __ARGS((void)); | |
36 | 37 | int swapping_screen __ARGS((void)); |
37 | 38 | void setmouse __ARGS((void)); |
38 | 39 | int mouse_has __ARGS((int c)); |
@@ -3001,7 +3001,7 @@ | ||
3001 | 3001 | qf_jump(0, 0, eap->forceit); /* display first error */ |
3002 | 3002 | } |
3003 | 3003 | else |
3004 | - EMSG(_("E999: String or List expected")); | |
3004 | + EMSG(_("E777: String or List expected")); | |
3005 | 3005 | free_tv(tv); |
3006 | 3006 | } |
3007 | 3007 | } |
@@ -945,6 +945,10 @@ | ||
945 | 945 | static char *e_affrange = N_("E762: Character in FOL, LOW or UPP is out of range"); |
946 | 946 | static char *msg_compressing = N_("Compressing word tree..."); |
947 | 947 | |
948 | +/* Remember what "z?" replaced. */ | |
949 | +static char_u *repl_from = NULL; | |
950 | +static char_u *repl_to = NULL; | |
951 | + | |
948 | 952 | /* |
949 | 953 | * Main spell-checking function. |
950 | 954 | * "ptr" points to a character that could be the start of a word. |
@@ -1657,8 +1661,8 @@ | ||
1657 | 1661 | } |
1658 | 1662 | |
1659 | 1663 | /* |
1660 | - * Return TRUE if "flags" is a valid sequence of compound flags and | |
1661 | - * "word[len]" does not have too many syllables. | |
1664 | + * Return TRUE if "flags" is a valid sequence of compound flags and "word" | |
1665 | + * does not have too many syllables. | |
1662 | 1666 | */ |
1663 | 1667 | static int |
1664 | 1668 | can_compound(slang, word, flags) |
@@ -1884,7 +1888,7 @@ | ||
1884 | 1888 | |
1885 | 1889 | /* |
1886 | 1890 | * Need to fold at least one more character. Do until next non-word character |
1887 | - * for efficiency. | |
1891 | + * for efficiency. Include the non-word character too. | |
1888 | 1892 | * Return the length of the folded chars in bytes. |
1889 | 1893 | */ |
1890 | 1894 | static int |
@@ -1900,8 +1904,7 @@ | ||
1900 | 1904 | mb_ptr_adv(mip->mi_fend); |
1901 | 1905 | } while (*mip->mi_fend != NUL && spell_iswordp(mip->mi_fend, mip->mi_buf)); |
1902 | 1906 | |
1903 | - /* Include the non-word character so that we can check for the | |
1904 | - * word end. */ | |
1907 | + /* Include the non-word character so that we can check for the word end. */ | |
1905 | 1908 | if (*mip->mi_fend != NUL) |
1906 | 1909 | mb_ptr_adv(mip->mi_fend); |
1907 | 1910 |
@@ -2201,6 +2204,9 @@ | ||
2201 | 2204 | } |
2202 | 2205 | } |
2203 | 2206 | |
2207 | +/* | |
2208 | + * Structure used for the cookie argument of do_in_runtimepath(). | |
2209 | + */ | |
2204 | 2210 | typedef struct spelload_S |
2205 | 2211 | { |
2206 | 2212 | char_u sl_lang[MAXWLEN + 1]; /* language name */ |
@@ -2246,7 +2252,7 @@ | ||
2246 | 2252 | lang, spell_enc(), lang); |
2247 | 2253 | else if (sl.sl_slang != NULL) |
2248 | 2254 | { |
2249 | - /* At least one file was loaded, now load all the additions. */ | |
2255 | + /* At least one file was loaded, now load ALL the additions. */ | |
2250 | 2256 | STRCPY(fname_enc + STRLEN(fname_enc) - 3, "add.spl"); |
2251 | 2257 | do_in_runtimepath(fname_enc, TRUE, spell_load_cb, &sl); |
2252 | 2258 | } |
@@ -2469,7 +2475,8 @@ | ||
2469 | 2475 | * - To reload a spell file that was changed. "lang" is NULL and "old_lp" |
2470 | 2476 | * points to the existing slang_T. |
2471 | 2477 | * - Just after writing a .spl file; it's read back to produce the .sug file. |
2472 | - * "old_lp" is NULL and "lang" is a dummy name. Will allocate an slang_T. | |
2478 | + * "old_lp" is NULL and "lang" is NULL. Will allocate an slang_T. | |
2479 | + * | |
2473 | 2480 | * Returns the slang_T the spell file was loaded into. NULL for error. |
2474 | 2481 | */ |
2475 | 2482 | static slang_T * |
@@ -2686,7 +2693,7 @@ | ||
2686 | 2693 | goto someerror; |
2687 | 2694 | |
2688 | 2695 | /* For a new file link it in the list of spell files. */ |
2689 | - if (old_lp == NULL) | |
2696 | + if (old_lp == NULL && lang != NULL) | |
2690 | 2697 | { |
2691 | 2698 | lp->sl_next = first_lang; |
2692 | 2699 | first_lang = lp; |
@@ -4358,6 +4365,11 @@ | ||
4358 | 4365 | } |
4359 | 4366 | |
4360 | 4367 | init_spell_chartab(); |
4368 | + | |
4369 | + vim_free(repl_to); | |
4370 | + repl_to = NULL; | |
4371 | + vim_free(repl_from); | |
4372 | + repl_from = NULL; | |
4361 | 4373 | } |
4362 | 4374 | # endif |
4363 | 4375 |
@@ -4423,7 +4435,7 @@ | ||
4423 | 4435 | } |
4424 | 4436 | |
4425 | 4437 | /* When "zg" was used and the file wasn't loaded yet, should redo |
4426 | - * 'spelllang' to get it loaded. */ | |
4438 | + * 'spelllang' to load it now. */ | |
4427 | 4439 | if (added_word && !didit) |
4428 | 4440 | did_set_spelllang(curbuf); |
4429 | 4441 | } |
@@ -7875,9 +7887,6 @@ | ||
7875 | 7887 | slang = spell_load_file(wfname, NULL, NULL, FALSE); |
7876 | 7888 | if (slang == NULL) |
7877 | 7889 | return; |
7878 | - /* don't want this language in the list */ | |
7879 | - if (first_lang == slang) | |
7880 | - first_lang = slang->sl_next; | |
7881 | 7890 | free_slang = TRUE; |
7882 | 7891 | } |
7883 | 7892 |
@@ -9339,10 +9348,6 @@ | ||
9339 | 9348 | return OK; |
9340 | 9349 | } |
9341 | 9350 | |
9342 | -/* Remember what "z?" replaced. */ | |
9343 | -static char_u *repl_from = NULL; | |
9344 | -static char_u *repl_to = NULL; | |
9345 | - | |
9346 | 9351 | /* |
9347 | 9352 | * "z?": Find badly spelled word under or after the cursor. |
9348 | 9353 | * Give suggestions for the properly spelled word. |
@@ -9720,22 +9725,22 @@ | ||
9720 | 9725 | |
9721 | 9726 | /* Make room in "gap". */ |
9722 | 9727 | ga_init2(gap, sizeof(char_u *), sug.su_ga.ga_len + 1); |
9723 | - if (ga_grow(gap, sug.su_ga.ga_len) == FAIL) | |
9724 | - return; | |
9725 | - | |
9726 | - for (i = 0; i < sug.su_ga.ga_len; ++i) | |
9727 | - { | |
9728 | - stp = &SUG(sug.su_ga, i); | |
9729 | - | |
9730 | - /* The suggested word may replace only part of "word", add the not | |
9731 | - * replaced part. */ | |
9732 | - wcopy = alloc(stp->st_wordlen | |
9728 | + if (ga_grow(gap, sug.su_ga.ga_len) == OK) | |
9729 | + { | |
9730 | + for (i = 0; i < sug.su_ga.ga_len; ++i) | |
9731 | + { | |
9732 | + stp = &SUG(sug.su_ga, i); | |
9733 | + | |
9734 | + /* The suggested word may replace only part of "word", add the not | |
9735 | + * replaced part. */ | |
9736 | + wcopy = alloc(stp->st_wordlen | |
9733 | 9737 | + STRLEN(sug.su_badptr + stp->st_orglen) + 1); |
9734 | - if (wcopy == NULL) | |
9735 | - break; | |
9736 | - STRCPY(wcopy, stp->st_word); | |
9737 | - STRCPY(wcopy + stp->st_wordlen, sug.su_badptr + stp->st_orglen); | |
9738 | - ((char_u **)gap->ga_data)[gap->ga_len++] = wcopy; | |
9738 | + if (wcopy == NULL) | |
9739 | + break; | |
9740 | + STRCPY(wcopy, stp->st_word); | |
9741 | + STRCPY(wcopy + stp->st_wordlen, sug.su_badptr + stp->st_orglen); | |
9742 | + ((char_u **)gap->ga_data)[gap->ga_len++] = wcopy; | |
9743 | + } | |
9739 | 9744 | } |
9740 | 9745 | |
9741 | 9746 | spell_find_cleanup(&sug); |
@@ -10110,20 +10115,20 @@ | ||
10110 | 10115 | buf[i] = getc(fd); /* <fileID> */ |
10111 | 10116 | if (STRNCMP(buf, VIMSUGMAGIC, VIMSUGMAGICL) != 0) |
10112 | 10117 | { |
10113 | - EMSG2(_("E999: This does not look like a .sug file: %s"), | |
10118 | + EMSG2(_("E778: This does not look like a .sug file: %s"), | |
10114 | 10119 | slang->sl_fname); |
10115 | 10120 | goto nextone; |
10116 | 10121 | } |
10117 | 10122 | c = getc(fd); /* <versionnr> */ |
10118 | 10123 | if (c < VIMSUGVERSION) |
10119 | 10124 | { |
10120 | - EMSG2(_("E999: Old .sug file, needs to be updated: %s"), | |
10125 | + EMSG2(_("E779: Old .sug file, needs to be updated: %s"), | |
10121 | 10126 | slang->sl_fname); |
10122 | 10127 | goto nextone; |
10123 | 10128 | } |
10124 | 10129 | else if (c > VIMSUGVERSION) |
10125 | 10130 | { |
10126 | - EMSG2(_("E999: .sug file is for newer version of Vim: %s"), | |
10131 | + EMSG2(_("E780: .sug file is for newer version of Vim: %s"), | |
10127 | 10132 | slang->sl_fname); |
10128 | 10133 | goto nextone; |
10129 | 10134 | } |
@@ -10135,7 +10140,7 @@ | ||
10135 | 10140 | timestamp += getc(fd) << (i * 8); |
10136 | 10141 | if (timestamp != slang->sl_sugtime) |
10137 | 10142 | { |
10138 | - EMSG2(_("E999: .sug file doesn't match .spl file: %s"), | |
10143 | + EMSG2(_("E781: .sug file doesn't match .spl file: %s"), | |
10139 | 10144 | slang->sl_fname); |
10140 | 10145 | goto nextone; |
10141 | 10146 | } |
@@ -10148,7 +10153,7 @@ | ||
10148 | 10153 | FALSE, 0) != 0) |
10149 | 10154 | { |
10150 | 10155 | someerror: |
10151 | - EMSG2(_("E999: error while reading .sug file: %s"), | |
10156 | + EMSG2(_("E782: error while reading .sug file: %s"), | |
10152 | 10157 | slang->sl_fname); |
10153 | 10158 | slang_clear_sug(slang); |
10154 | 10159 | goto nextone; |
@@ -12786,7 +12791,7 @@ | ||
12786 | 12791 | { |
12787 | 12792 | /* This should have been checked when generating the .spl |
12788 | 12793 | * file. */ |
12789 | - EMSG(_("E999: duplicate char in MAP entry")); | |
12794 | + EMSG(_("E783: duplicate char in MAP entry")); | |
12790 | 12795 | vim_free(b); |
12791 | 12796 | } |
12792 | 12797 | } |
@@ -13026,7 +13031,7 @@ | ||
13026 | 13031 | suginfo_T *su; |
13027 | 13032 | char_u *word; |
13028 | 13033 | { |
13029 | - char_u *s = vim_strsave(word); | |
13034 | + char_u *s; | |
13030 | 13035 | hash_T hash; |
13031 | 13036 | hashitem_T *hi; |
13032 | 13037 |
@@ -14888,7 +14893,7 @@ | ||
14888 | 14893 | int len; |
14889 | 14894 | int i; |
14890 | 14895 | |
14891 | - /* if the word starts with a lower-case letter make the word with an | |
14896 | + /* If the word starts with a lower-case letter make the word with an | |
14892 | 14897 | * upper-case letter in word_up[]. */ |
14893 | 14898 | c = PTR2CHAR(word); |
14894 | 14899 | if (SPELL_TOUPPER(c) != c) |
@@ -14973,7 +14978,8 @@ | ||
14973 | 14978 | } |
14974 | 14979 | |
14975 | 14980 | /* |
14976 | - * Move "p" to end of word. | |
14981 | + * Move "p" to the end of word "start". | |
14982 | + * Uses the spell-checking word characters. | |
14977 | 14983 | */ |
14978 | 14984 | char_u * |
14979 | 14985 | spell_to_word_end(start, buf) |
@@ -14989,10 +14995,10 @@ | ||
14989 | 14995 | |
14990 | 14996 | #if defined(FEAT_INS_EXPAND) || defined(PROTO) |
14991 | 14997 | /* |
14992 | - * Find start of the word in front of the cursor. We don't check if it is | |
14993 | - * badly spelled, with completion we can only change the word in front of the | |
14994 | - * cursor. | |
14995 | - * Used for Insert mode completion CTRL-X ?. | |
14998 | + * For Insert mode completion CTRL-X s: | |
14999 | + * Find start of the word in front of column "startcol". | |
15000 | + * We don't check if it is badly spelled, with completion we can only change | |
15001 | + * the word in front of the cursor. | |
14996 | 15002 | * Returns the column number of the word. |
14997 | 15003 | */ |
14998 | 15004 | int |
@@ -2956,6 +2956,7 @@ | ||
2956 | 2956 | int extra; /* extra chars for offset to start */ |
2957 | 2957 | { |
2958 | 2958 | int col; |
2959 | + int len; | |
2959 | 2960 | |
2960 | 2961 | if (spp->sp_off_flags & (1 << idx)) |
2961 | 2962 | { |
@@ -2971,7 +2972,15 @@ | ||
2971 | 2972 | if (col < 0) |
2972 | 2973 | result->col = 0; |
2973 | 2974 | else |
2974 | - result->col = col; | |
2975 | + { | |
2976 | + /* Don't go past the end of the line. Matters for "rs=e+2" when there | |
2977 | + * is a matchgroup. */ | |
2978 | + len = STRLEN(ml_get_buf(syn_buf, result->lnum, FALSE)); | |
2979 | + if (col > len) | |
2980 | + result->col = len; | |
2981 | + else | |
2982 | + result->col = col; | |
2983 | + } | |
2975 | 2984 | } |
2976 | 2985 | |
2977 | 2986 | /* |
@@ -88,9 +88,6 @@ | ||
88 | 88 | || (defined(FEAT_MOUSE) && (!defined(UNIX) || defined(FEAT_MOUSE_XTERM))) |
89 | 89 | static int get_bytes_from_buf __ARGS((char_u *, char_u *, int)); |
90 | 90 | #endif |
91 | -#ifdef FEAT_TERMRESPONSE | |
92 | -static void may_req_termresponse __ARGS((void)); | |
93 | -#endif | |
94 | 91 | static void del_termcode_idx __ARGS((int idx)); |
95 | 92 | static int term_is_builtin __ARGS((char_u *name)); |
96 | 93 | static int term_7to8bit __ARGS((char_u *p)); |
@@ -3249,11 +3246,13 @@ | ||
3249 | 3246 | } |
3250 | 3247 | } |
3251 | 3248 | |
3252 | -#ifdef FEAT_TERMRESPONSE | |
3249 | +#if defined(FEAT_TERMRESPONSE) || defined(PROTO) | |
3253 | 3250 | /* |
3254 | 3251 | * Request version string (for xterm) when needed. |
3255 | 3252 | * Only do this after switching to raw mode, otherwise the result will be |
3256 | 3253 | * echoed. |
3254 | + * Only do this after startup has finished, to avoid that the response comes | |
3255 | + * while excuting "-c !cmd" or even after "-c quit". | |
3257 | 3256 | * Only do this after termcap mode has been started, otherwise the codes for |
3258 | 3257 | * the cursor keys may be wrong. |
3259 | 3258 | * Only do this when 'esckeys' is on, otherwise the response causes trouble in |
@@ -3262,17 +3261,18 @@ | ||
3262 | 3261 | * request to terminal while reading from a file). |
3263 | 3262 | * The result is caught in check_termcode(). |
3264 | 3263 | */ |
3265 | - static void | |
3264 | + void | |
3266 | 3265 | may_req_termresponse() |
3267 | 3266 | { |
3268 | 3267 | if (crv_status == CRV_GET |
3269 | 3268 | && cur_tmode == TMODE_RAW |
3269 | + && starting == 0 | |
3270 | 3270 | && termcap_active |
3271 | 3271 | && p_ek |
3272 | -#ifdef UNIX | |
3272 | +# ifdef UNIX | |
3273 | 3273 | && isatty(1) |
3274 | 3274 | && isatty(read_cmd_fd) |
3275 | -#endif | |
3275 | +# endif | |
3276 | 3276 | && *T_CRV != NUL) |
3277 | 3277 | { |
3278 | 3278 | out_str(T_CRV); |
@@ -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 (2006 Jan 12)" | |
40 | -#define VIM_VERSION_LONG_DATE "VIM - Vi IMproved 7.0aa ALPHA (2006 Jan 12, compiled " | |
39 | +#define VIM_VERSION_LONG "VIM - Vi IMproved 7.0aa ALPHA (2006 Jan 13)" | |
40 | +#define VIM_VERSION_LONG_DATE "VIM - Vi IMproved 7.0aa ALPHA (2006 Jan 13, compiled " |