Mirror of the Vim source from https://github.com/vim/vim
リビジョン | 41f9fd58cf132788bde73ab1954cb987521e3bd2 (tree) |
---|---|
日時 | 2004-10-13 05:02:24 |
作者 | vimboss |
コミッター | vimboss |
updated for version 7.0019
@@ -1,4 +1,4 @@ | ||
1 | -*change.txt* For Vim version 7.0aa. Last change: 2004 Sep 16 | |
1 | +*change.txt* For Vim version 7.0aa. Last change: 2004 Oct 11 | |
2 | 2 | |
3 | 3 | |
4 | 4 | VIM REFERENCE MANUAL by Bram Moolenaar |
@@ -13,6 +13,10 @@ | ||
13 | 13 | 2. Delete and insert |delete-insert| |
14 | 14 | 3. Simple changes |simple-change| *changing* |
15 | 15 | 4. Complex changes |complex-change| |
16 | + 4.1 Filter commands |filter| | |
17 | + 4.2 Substitute |:substitute| | |
18 | + 4.3 Search and replace |search-replace| | |
19 | + 4.4 Changing tabs |change-tabs| | |
16 | 20 | 5. Copying and moving text |copy-move| |
17 | 21 | 6. Formatting text |formatting| |
18 | 22 |
@@ -449,7 +453,19 @@ | ||
449 | 453 | ============================================================================== |
450 | 454 | 4. Complex changes *complex-change* |
451 | 455 | |
452 | - *!* *filter* | |
456 | +4.1 Filter commands *filter* | |
457 | + | |
458 | +A filter is a program that accepts text at standard input, changes it in some | |
459 | +way, and sends it to standard output. You can use the commands below to send | |
460 | +some text through a filter, so that it is replace by the filter output. | |
461 | +Examples of filters are "sort", which sorts lines alphabetically, and | |
462 | +"indent", which formats C program files (you need a version of indent that | |
463 | +works like a filter; not all versions do). The 'shell' option specifies the | |
464 | +shell Vim uses to execute the filter command (See also the 'shelltype' | |
465 | +option). You can repeat filter commands with ".". Vim does not recognize a | |
466 | +comment (starting with '"') after the ":!" command. | |
467 | + | |
468 | + *!* | |
453 | 469 | !{motion}{filter} Filter {motion} text lines through the external |
454 | 470 | program {filter}. |
455 | 471 |
@@ -492,17 +508,9 @@ | ||
492 | 508 | {Visual}= Filter the highlighted lines like with ={motion}. |
493 | 509 | {not in Vi} |
494 | 510 | |
495 | -A filter is a program that accepts text at standard input, changes it in some | |
496 | -way, and sends it to standard output. You can use the commands above to send | |
497 | -some text through a filter. Examples of filters are "sort", which sorts lines | |
498 | -alphabetically, and "indent", which formats C program files (you need a | |
499 | -version of indent that works like a filter; not all versions do). The 'shell' | |
500 | -option specifies the shell Vim uses to execute the filter command (See also | |
501 | -the 'shelltype' option). You can repeat filter commands with ".". Vim does | |
502 | -not recognize a comment (starting with '"') after the ":!" command. | |
503 | 511 | |
504 | - | |
505 | - *:s* *:su* *:substitute* | |
512 | +4.2 Substitute *:substitute* | |
513 | + *:s* *:su* | |
506 | 514 | :[range]s[ubstitute]/{pattern}/{string}/[&][c][e][g][p][r][i][I] [count] |
507 | 515 | For each line in [range] replace a match of {pattern} |
508 | 516 | with {string}. |
@@ -741,7 +749,9 @@ | ||
741 | 749 | This replaces an end-of-line with a new line containing the value of $HOME. |
742 | 750 | |
743 | 751 | |
744 | - *:pro* *:promptfind* | |
752 | +4.3 Search and replace *search-replace* | |
753 | + | |
754 | + *:pro* *:promptfind* | |
745 | 755 | :promptf[ind] [string] |
746 | 756 | Put up a Search dialog. When [string] is given, it is |
747 | 757 | used as the initial search string. |
@@ -753,6 +763,8 @@ | ||
753 | 763 | given, it is used as the initial search string. |
754 | 764 | {only for Win32, Motif and GTK GUI} |
755 | 765 | |
766 | + | |
767 | +4.4 Changing tabs *change-tabs* | |
756 | 768 | *:ret* *:retab* |
757 | 769 | :[range]ret[ab][!] [new_tabstop] |
758 | 770 | Replace all sequences of white-space containing a |
@@ -1,4 +1,4 @@ | ||
1 | -*eval.txt* For Vim version 7.0aa. Last change: 2004 Oct 10 | |
1 | +*eval.txt* For Vim version 7.0aa. Last change: 2004 Oct 11 | |
2 | 2 | |
3 | 3 | |
4 | 4 | VIM REFERENCE MANUAL by Bram Moolenaar |
@@ -831,6 +831,8 @@ | ||
831 | 831 | cursor( {lnum}, {col}) Number position cursor at {lnum}, {col} |
832 | 832 | delete( {fname}) Number delete file {fname} |
833 | 833 | did_filetype() Number TRUE if FileType autocommand event used |
834 | +diff_filler( {lnum}) Number diff filler lines about {lnum} | |
835 | +diff_hlID( {lnum}, {col}) Number diff highlighting at {lnum}/{col} | |
834 | 836 | escape( {string}, {chars}) String escape {chars} in {string} with '\' |
835 | 837 | eventhandler( ) Number TRUE if inside an event handler |
836 | 838 | executable( {expr}) Number 1 if executable {expr} exists |
@@ -932,7 +934,7 @@ | ||
932 | 934 | submatch( {nr}) String specific match in ":substitute" |
933 | 935 | substitute( {expr}, {pat}, {sub}, {flags}) |
934 | 936 | String all {pat} in {expr} replaced with {sub} |
935 | -synID( {line}, {col}, {trans}) Number syntax ID at {line} and {col} | |
937 | +synID( {lnum}, {col}, {trans}) Number syntax ID at {lnum} and {col} | |
936 | 938 | synIDattr( {synID}, {what} [, {mode}]) |
937 | 939 | String attribute {what} of syntax ID {synID} |
938 | 940 | synIDtrans( {synID}) Number translated syntax ID of {synID} |
@@ -1270,6 +1272,26 @@ | ||
1270 | 1272 | editing another buffer to set 'filetype' and load a syntax |
1271 | 1273 | file. |
1272 | 1274 | |
1275 | +diff_filler({lnum}) *diff_filler()* | |
1276 | + Returns the number of filler lines above line {lnum}. | |
1277 | + These are the lines that were inserted at this point in | |
1278 | + another diff'ed window. These filler lines are shown in the | |
1279 | + display but don't exist in the buffer. | |
1280 | + {lnum} is used like with |getline()|. Thus "." is the current | |
1281 | + line, "'m" mark m, etc. | |
1282 | + Returns 0 if the current window is not in diff mode. | |
1283 | + | |
1284 | +diff_hlID({lnum}, {col}) *diff_hlID()* | |
1285 | + Returns the highlight ID for diff mode at line {lnum} column | |
1286 | + {col} (byte index). When the current line does not have a | |
1287 | + diff change zero is returned. | |
1288 | + {lnum} is used like with |getline()|. Thus "." is the current | |
1289 | + line, "'m" mark m, etc. | |
1290 | + {col} is 1 for the leftmost column, {lnum} is 1 for the first | |
1291 | + line. | |
1292 | + The highlight ID can be used with |synIDattr()| to obtain | |
1293 | + syntax information about the highlighting. | |
1294 | + | |
1273 | 1295 | escape({string}, {chars}) *escape()* |
1274 | 1296 | Escape the characters in {chars} that occur in {string} with a |
1275 | 1297 | backslash. Example: > |
@@ -2630,12 +2652,12 @@ | ||
2630 | 2652 | :echo substitute("testing", ".*", "\\U\\0", "") |
2631 | 2653 | < results in "TESTING". |
2632 | 2654 | |
2633 | -synID({line}, {col}, {trans}) *synID()* | |
2655 | +synID({lnum}, {col}, {trans}) *synID()* | |
2634 | 2656 | The result is a Number, which is the syntax ID at the position |
2635 | - {line} and {col} in the current window. | |
2657 | + {lnum} and {col} in the current window. | |
2636 | 2658 | The syntax ID can be used with |synIDattr()| and |
2637 | 2659 | |synIDtrans()| to obtain syntax information about text. |
2638 | - {col} is 1 for the leftmost column, {line} is 1 for the first | |
2660 | + {col} is 1 for the leftmost column, {lnum} is 1 for the first | |
2639 | 2661 | line. |
2640 | 2662 | When {trans} is non-zero, transparent items are reduced to the |
2641 | 2663 | item that they reveal. This is useful when wanting to know |
@@ -1,4 +1,4 @@ | ||
1 | -*syntax.txt* For Vim version 7.0aa. Last change: 2004 Oct 10 | |
1 | +*syntax.txt* For Vim version 7.0aa. Last change: 2004 Oct 12 | |
2 | 2 | |
3 | 3 | |
4 | 4 | VIM REFERENCE MANUAL by Bram Moolenaar |
@@ -420,6 +420,16 @@ | ||
420 | 420 | variable: > |
421 | 421 | :unlet html_use_encoding |
422 | 422 | < |
423 | +Closed folds are kept as they are displayed. If you don't want closed folds | |
424 | +in the HTML use the |zR| command before converting. | |
425 | + | |
426 | +For diff mode a sequence of more than 3 filler lines is displayed as three | |
427 | +lines with the middle line mentioning the total number of inserted lines. If | |
428 | +you prefer to see all the inserted lines use: > | |
429 | + :let html_whole_filler = 1 | |
430 | +And to go back to displaying up to three lines again: > | |
431 | + :unlet html_whole_filler | |
432 | + | |
423 | 433 | *convert-to-XML* *convert-to-XHTML* |
424 | 434 | An alternative is to have the script generate XHTML (XML compliant HTML). To |
425 | 435 | do this set the "use_xhtml" variable: > |
@@ -4161,6 +4161,7 @@ | ||
4161 | 4161 | ch-syntax syntax.txt /*ch-syntax* |
4162 | 4162 | ch.vim syntax.txt /*ch.vim* |
4163 | 4163 | change-list-jumps motion.txt /*change-list-jumps* |
4164 | +change-tabs change.txt /*change-tabs* | |
4164 | 4165 | change.txt change.txt /*change.txt* |
4165 | 4166 | changed-5.1 version5.txt /*changed-5.1* |
4166 | 4167 | changed-5.2 version5.txt /*changed-5.2* |
@@ -4417,6 +4418,8 @@ | ||
4417 | 4418 | diff-options diff.txt /*diff-options* |
4418 | 4419 | diff-patchexpr diff.txt /*diff-patchexpr* |
4419 | 4420 | diff.txt diff.txt /*diff.txt* |
4421 | +diff_filler() eval.txt /*diff_filler()* | |
4422 | +diff_hlID() eval.txt /*diff_hlID()* | |
4420 | 4423 | digraph-arg change.txt /*digraph-arg* |
4421 | 4424 | digraph-encoding digraph.txt /*digraph-encoding* |
4422 | 4425 | digraph-table digraph.txt /*digraph-table* |
@@ -4691,6 +4694,7 @@ | ||
4691 | 4694 | foldlevel-variable eval.txt /*foldlevel-variable* |
4692 | 4695 | foldstart-variable eval.txt /*foldstart-variable* |
4693 | 4696 | foldtext() eval.txt /*foldtext()* |
4697 | +foldtextresult() eval.txt /*foldtextresult()* | |
4694 | 4698 | font-sizes gui_x11.txt /*font-sizes* |
4695 | 4699 | fontset mbyte.txt /*fontset* |
4696 | 4700 | foreground() eval.txt /*foreground()* |
@@ -5935,6 +5939,7 @@ | ||
5935 | 5939 | search-offset pattern.txt /*search-offset* |
5936 | 5940 | search-pattern pattern.txt /*search-pattern* |
5937 | 5941 | search-range pattern.txt /*search-range* |
5942 | +search-replace change.txt /*search-replace* | |
5938 | 5943 | searchpair() eval.txt /*searchpair()* |
5939 | 5944 | section motion.txt /*section* |
5940 | 5945 | sed-syntax syntax.txt /*sed-syntax* |
@@ -1,4 +1,4 @@ | ||
1 | -*todo.txt* For Vim version 7.0aa. Last change: 2004 Oct 10 | |
1 | +*todo.txt* For Vim version 7.0aa. Last change: 2004 Oct 12 | |
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 | -Folding support for 2html. (Carl Osterwisch, Oct 4) | |
34 | -Now diff output! | |
35 | - | |
36 | 33 | Aborting at the ATTENTION prompt causes trouble: |
37 | 34 | buffer remains active, nwindows isn't closed (fixed in buffer.c) |
38 | 35 | alternate buffer gets "read error" flag. |
@@ -196,6 +193,10 @@ | ||
196 | 193 | Also: when the environment variable exists, use it. If it doesn't |
197 | 194 | exist, set it. Requires good names: $VIM_USER_VIMRC $VIM_USER_DIR |
198 | 195 | |
196 | +xterm title: After setting a title, obtaining the title still may result in | |
197 | +the old one. Sometimes happens with the test scripts. Setting the title is | |
198 | +done with an ESC sequence, obtaining the old title with an X library call. | |
199 | +Invoking XFlush() before getting the title doesn't help. | |
199 | 200 | |
200 | 201 | - In the kvim/KDE source files fix the formatting. |
201 | 202 | - KDE version is called "kvim". Make it "gvim", like the others? |
@@ -360,6 +361,8 @@ | ||
360 | 361 | |
361 | 362 | Add gui_mch_browsedir() for Motif, KDE and Mac OS/X. |
362 | 363 | |
364 | +Translated manual pages: Install German one in /usr/local/man/de/man1/vim.1 | |
365 | + | |
363 | 366 | |
364 | 367 | Vi incompatibility: |
365 | 368 | 9 In Ex mode, "u" undoes all changes, not just the last one. (John Cowan) |
@@ -1281,9 +1284,6 @@ | ||
1281 | 1284 | commands skip over a closed fold. |
1282 | 1285 | 8 "H" and "L" count buffer lines instead of window lines. (Servatius Brandt) |
1283 | 1286 | 8 Add a way to add fold-plugins. Johannes Zellner has one for VB. |
1284 | -7 When using 2html.vim, also reproduce folds as you can see them. When | |
1285 | - someone doesn't want the folds he can disable them before converting. | |
1286 | - First attempt by Carl Osterwisch, 2004 May 10. | |
1287 | 1287 | 7 When using manual folding, the undo command should also restore folds. |
1288 | 1288 | - Allow completely hiding a closed fold. Require showing a character in |
1289 | 1289 | 'foldcolumn' to avoid the missing line goes unnoticed. |
@@ -1,4 +1,4 @@ | ||
1 | -*version7.txt* For Vim version 7.0aa. Last change: 2004 Oct 11 | |
1 | +*version7.txt* For Vim version 7.0aa. Last change: 2004 Oct 12 | |
2 | 2 | |
3 | 3 | |
4 | 4 | VIM REFERENCE MANUAL by Bram Moolenaar |
@@ -54,6 +54,7 @@ | ||
54 | 54 | The "2html.vim" script now converts closed folds to HTML. This means the HTML |
55 | 55 | looks like its displayed, with the same folds open and closed. Use "zR" if no |
56 | 56 | folds should appear in the HTML. (partly by Carl Osterwisch) |
57 | +Diff mode now is also converted as it is displayed. | |
57 | 58 | |
58 | 59 | ============================================================================== |
59 | 60 | NEW FEATURES *new-7* |
@@ -187,6 +188,11 @@ | ||
187 | 188 | PHP compiler plugin. (Doug Kearns) |
188 | 189 | |
189 | 190 | |
191 | +New Keymaps: ~ | |
192 | + | |
193 | +Sinhala (Sri Lanka) (Harshula Jayasuriya) | |
194 | + | |
195 | + | |
190 | 196 | New message translations: ~ |
191 | 197 | |
192 | 198 | The Ukranian messages are now also available in cp1251. |
@@ -1,6 +1,6 @@ | ||
1 | 1 | " Vim syntax support file |
2 | 2 | " Maintainer: Bram Moolenaar <Bram@vim.org> |
3 | -" Last Change: 2004 Oct 10 | |
3 | +" Last Change: 2004 Oct 12 | |
4 | 4 | " (modified by David Ne\v{c}as (Yeti) <yeti@physics.muni.cz>) |
5 | 5 | " (XHTML support by Panagiotis Issaris <takis@lumumba.luc.ac.be>) |
6 | 6 |
@@ -251,20 +251,67 @@ | ||
251 | 251 | unlet s:c |
252 | 252 | endif |
253 | 253 | |
254 | +" For diff filler lines | |
255 | +if has('diff') | |
256 | + if s:numblines | |
257 | + let s:fillerline = strpart(' ', 0, strlen(line("$"))) . ' ' | |
258 | + else | |
259 | + let s:fillerline = '' | |
260 | + endif | |
261 | + let s:fillchar = &fillchars[matchend(&fillchars, 'diff:')] | |
262 | + if s:fillchar == '' | |
263 | + let s:fillchar = '-' | |
264 | + endif | |
265 | + while strlen(s:fillerline) < &columns | |
266 | + let s:fillerline = s:fillerline . s:fillchar | |
267 | + endwhile | |
268 | +endif | |
254 | 269 | |
255 | 270 | while s:lnum <= s:end |
256 | 271 | |
272 | + " If there are filler lines for diff mode, show these above the line. | |
273 | + let s:filler = diff_filler(s:lnum) | |
274 | + if s:filler > 0 | |
275 | + let s:n = s:filler | |
276 | + while s:n > 0 | |
277 | + if s:n > 2 && s:n < s:filler && !exists("html_whole_filler") | |
278 | + let s:new = strpart(s:fillerline, 0, 3) . " " . s:filler . " inserted lines " | |
279 | + let s:new = s:new . strpart(s:fillerline, strlen(s:new)) | |
280 | + let s:n = 2 | |
281 | + else | |
282 | + let s:new = s:fillerline | |
283 | + endif | |
284 | + let s:id_name = "DiffDelete" | |
285 | + let s:id = hlID(s:id_name) | |
286 | + let s:new = '<span class="' . s:id_name . '">' . s:new . '</span>' | |
287 | + " Add the class to class list if it's not there yet | |
288 | + if stridx(s:idlist, "," . s:id . ",") == -1 | |
289 | + let s:idlist = s:idlist . s:id . "," | |
290 | + endif | |
291 | + | |
292 | + exe s:newwin . "wincmd w" | |
293 | + exe "normal! a" . strtrans(s:new) . "\n\e" | |
294 | + exe s:orgwin . "wincmd w" | |
295 | + let s:n = s:n - 1 | |
296 | + endwhile | |
297 | + unlet s:n | |
298 | + endif | |
299 | + unlet s:filler | |
300 | + | |
301 | + " Start the line with the line number. | |
302 | + if s:numblines | |
303 | + let s:new = strpart(' ', 0, strlen(line("$")) - strlen(s:lnum)) . s:lnum . ' ' | |
304 | + else | |
305 | + let s:new = "" | |
306 | + endif | |
307 | + | |
257 | 308 | " Get the current line |
258 | 309 | let s:line = getline(s:lnum) |
259 | - let s:new = "" | |
260 | 310 | |
261 | 311 | if has('folding') && foldclosed(s:lnum) > -1 |
262 | 312 | " |
263 | 313 | " This is the beginning of a folded block |
264 | 314 | " |
265 | - if s:numblines | |
266 | - let s:new = strpart(' ', 0, strlen(line("$")) - strlen(s:lnum)) . s:lnum . ' ' | |
267 | - endif | |
268 | 315 | let s:line = foldtextresult(s:lnum) |
269 | 316 | |
270 | 317 | let s:new = s:new . s:line |
@@ -293,18 +340,34 @@ | ||
293 | 340 | let s:len = strlen(s:line) |
294 | 341 | |
295 | 342 | if s:numblines |
296 | - let s:new = '<span class="lnr">' . strpart(' ', 0, strlen(line("$")) - strlen(s:lnum)) . s:lnum . '</span> ' | |
343 | + let s:new = '<span class="lnr">' . s:new . '</span> ' | |
297 | 344 | endif |
298 | 345 | |
346 | + " Get the diff attribute, if any. | |
347 | + let s:diffattr = diff_hlID(s:lnum, 1) | |
348 | + | |
299 | 349 | " Loop over each character in the line |
300 | 350 | let s:col = 1 |
301 | 351 | while s:col <= s:len |
302 | 352 | let s:startcol = s:col " The start column for processing text |
303 | - let s:id = synID(s:lnum, s:col, 1) | |
304 | - let s:col = s:col + 1 | |
305 | - " Speed loop (it's small - that's the trick) | |
306 | - " Go along till we find a change in synID | |
307 | - while s:col <= s:len && s:id == synID(s:lnum, s:col, 1) | let s:col = s:col + 1 | endwhile | |
353 | + if s:diffattr | |
354 | + let s:id = diff_hlID(s:lnum, s:col) | |
355 | + let s:col = s:col + 1 | |
356 | + " Speed loop (it's small - that's the trick) | |
357 | + " Go along till we find a change in hlID | |
358 | + while s:col <= s:len && s:id == diff_hlID(s:lnum, s:col) | let s:col = s:col + 1 | endwhile | |
359 | + while s:len < &columns | |
360 | + " Add spaces at the end to mark the changed line. | |
361 | + let s:line = s:line . ' ' | |
362 | + let s:len = s:len + 1 | |
363 | + endwhile | |
364 | + else | |
365 | + let s:id = synID(s:lnum, s:col, 1) | |
366 | + let s:col = s:col + 1 | |
367 | + " Speed loop (it's small - that's the trick) | |
368 | + " Go along till we find a change in synID | |
369 | + while s:col <= s:len && s:id == synID(s:lnum, s:col, 1) | let s:col = s:col + 1 | endwhile | |
370 | + endif | |
308 | 371 | |
309 | 372 | " Output the text with the same synID, with class set to {s:id_name} |
310 | 373 | let s:id = synIDtrans(s:id) |
@@ -457,3 +520,4 @@ | ||
457 | 520 | delfunc s:HtmlOpening |
458 | 521 | delfunc s:HtmlClosing |
459 | 522 | endif |
523 | +silent! unlet s:htmlfoldtext s:fillerline s:diffattr |
@@ -2271,7 +2271,7 @@ | ||
2271 | 2271 | echo $ac_n "checking for location of Tcl include""... $ac_c" 1>&6 |
2272 | 2272 | echo "configure:2273: checking for location of Tcl include" >&5 |
2273 | 2273 | if test "x$MACOSX" != "xyes"; then |
2274 | - tclinc="$tclloc/include $tclloc/include/tcl $tclloc/include/tcl$tclver /usr/local/include" | |
2274 | + tclinc="$tclloc/include $tclloc/include/tcl $tclloc/include/tcl$tclver /usr/local/include /usr/include" | |
2275 | 2275 | else |
2276 | 2276 | tclinc="/System/Library/Frameworks/Tcl.framework/Headers" |
2277 | 2277 | fi |
@@ -713,7 +713,7 @@ | ||
713 | 713 | |
714 | 714 | AC_MSG_CHECKING(for location of Tcl include) |
715 | 715 | if test "x$MACOSX" != "xyes"; then |
716 | - tclinc="$tclloc/include $tclloc/include/tcl $tclloc/include/tcl$tclver /usr/local/include" | |
716 | + tclinc="$tclloc/include $tclloc/include/tcl $tclloc/include/tcl$tclver /usr/local/include /usr/include" | |
717 | 717 | else |
718 | 718 | dnl For Mac OS X 10.3, use the OS-provided framework location |
719 | 719 | tclinc="/System/Library/Frameworks/Tcl.framework/Headers" |
@@ -274,6 +274,8 @@ | ||
274 | 274 | static void f_cursor __ARGS((VAR argsvars, VAR retvar)); |
275 | 275 | static void f_delete __ARGS((VAR argvars, VAR retvar)); |
276 | 276 | static void f_did_filetype __ARGS((VAR argvars, VAR retvar)); |
277 | +static void f_diff_filler __ARGS((VAR argvars, VAR retvar)); | |
278 | +static void f_diff_hlID __ARGS((VAR argvars, VAR retvar)); | |
277 | 279 | static void f_escape __ARGS((VAR argvars, VAR retvar)); |
278 | 280 | static void f_eventhandler __ARGS((VAR argvars, VAR retvar)); |
279 | 281 | static void f_executable __ARGS((VAR argvars, VAR retvar)); |
@@ -2837,6 +2839,8 @@ | ||
2837 | 2839 | {"cursor", 2, 2, f_cursor}, |
2838 | 2840 | {"delete", 1, 1, f_delete}, |
2839 | 2841 | {"did_filetype", 0, 0, f_did_filetype}, |
2842 | + {"diff_filler", 1, 1, f_diff_filler}, | |
2843 | + {"diff_hlID", 2, 2, f_diff_hlID}, | |
2840 | 2844 | {"escape", 2, 2, f_escape}, |
2841 | 2845 | {"eventhandler", 0, 0, f_eventhandler}, |
2842 | 2846 | {"executable", 1, 1, f_executable}, |
@@ -3977,6 +3981,79 @@ | ||
3977 | 3981 | } |
3978 | 3982 | |
3979 | 3983 | /* |
3984 | + * "diff_filler()" function | |
3985 | + */ | |
3986 | +/*ARGSUSED*/ | |
3987 | + static void | |
3988 | +f_diff_filler(argvars, retvar) | |
3989 | + VAR argvars; | |
3990 | + VAR retvar; | |
3991 | +{ | |
3992 | +#ifdef FEAT_DIFF | |
3993 | + retvar->var_val.var_number = diff_check_fill(curwin, get_var_lnum(argvars)); | |
3994 | +#endif | |
3995 | +} | |
3996 | + | |
3997 | +/* | |
3998 | + * "diff_hlID()" function | |
3999 | + */ | |
4000 | +/*ARGSUSED*/ | |
4001 | + static void | |
4002 | +f_diff_hlID(argvars, retvar) | |
4003 | + VAR argvars; | |
4004 | + VAR retvar; | |
4005 | +{ | |
4006 | +#ifdef FEAT_DIFF | |
4007 | + linenr_T lnum = get_var_lnum(argvars); | |
4008 | + static linenr_T prev_lnum = 0; | |
4009 | + static int changedtick = 0; | |
4010 | + static int fnum = 0; | |
4011 | + static int change_start = 0; | |
4012 | + static int change_end = 0; | |
4013 | + static enum hlf_value hlID = 0; | |
4014 | + int filler_lines; | |
4015 | + int col; | |
4016 | + | |
4017 | + if (lnum != prev_lnum | |
4018 | + || changedtick != curbuf->b_changedtick | |
4019 | + || fnum != curbuf->b_fnum) | |
4020 | + { | |
4021 | + /* New line, buffer, change: need to get the values. */ | |
4022 | + filler_lines = diff_check(curwin, lnum); | |
4023 | + if (filler_lines < 0) | |
4024 | + { | |
4025 | + if (filler_lines == -1) | |
4026 | + { | |
4027 | + change_start = MAXCOL; | |
4028 | + change_end = -1; | |
4029 | + if (diff_find_change(curwin, lnum, &change_start, &change_end)) | |
4030 | + hlID = HLF_ADD; /* added line */ | |
4031 | + else | |
4032 | + hlID = HLF_CHD; /* changed line */ | |
4033 | + } | |
4034 | + else | |
4035 | + hlID = HLF_ADD; /* added line */ | |
4036 | + } | |
4037 | + else | |
4038 | + hlID = (enum hlf_value)0; | |
4039 | + prev_lnum = lnum; | |
4040 | + changedtick = curbuf->b_changedtick; | |
4041 | + fnum = curbuf->b_fnum; | |
4042 | + } | |
4043 | + | |
4044 | + if (hlID == HLF_CHD || hlID == HLF_TXD) | |
4045 | + { | |
4046 | + col = get_var_number(&argvars[1]) - 1; | |
4047 | + if (col >= change_start && col <= change_end) | |
4048 | + hlID = HLF_TXD; /* changed text */ | |
4049 | + else | |
4050 | + hlID = HLF_CHD; /* changed line */ | |
4051 | + } | |
4052 | + retvar->var_val.var_number = hlID == (enum hlf_value)0 ? 0 : (int)hlID; | |
4053 | +#endif | |
4054 | +} | |
4055 | + | |
4056 | +/* | |
3980 | 4057 | * "escape({string}, {chars})" function |
3981 | 4058 | */ |
3982 | 4059 | static void |
@@ -1535,13 +1535,7 @@ | ||
1535 | 1535 | get_x11_title(test_only) |
1536 | 1536 | int test_only; |
1537 | 1537 | { |
1538 | - int retval; | |
1539 | - | |
1540 | - retval = get_x11_thing(TRUE, test_only); | |
1541 | - | |
1542 | - /* could not get old title: oldtitle == NULL */ | |
1543 | - | |
1544 | - return retval; | |
1538 | + return get_x11_thing(TRUE, test_only); | |
1545 | 1539 | } |
1546 | 1540 | |
1547 | 1541 | /* |
@@ -1829,7 +1823,8 @@ | ||
1829 | 1823 | * than x11 calls, because the x11 calls don't always work |
1830 | 1824 | */ |
1831 | 1825 | #ifdef FEAT_GUI_KDE |
1832 | - /* dont know why but KDE needs this one as we don't go through the next function... */ | |
1826 | + /* dont know why but KDE needs this one as we don't go through the next | |
1827 | + * function... */ | |
1833 | 1828 | gui_mch_settitle(title, icon); |
1834 | 1829 | #endif |
1835 | 1830 | if ((type || *T_TS != NUL) && title != NULL) |
@@ -47,6 +47,8 @@ | ||
47 | 47 | .in.out: |
48 | 48 | -rm -f $*.failed test.ok X* |
49 | 49 | cp $*.ok test.ok |
50 | + # Sleep a moment to avoid that the xterm title is messed up | |
51 | + @-sleep .2 | |
50 | 52 | $(VIMPROG) -u unix.vim -U NONE --noplugin -s dotest.in $*.in |
51 | 53 | @/bin/sh -c "if diff test.out $*.ok; \ |
52 | 54 | then mv -f test.out $*.out; \ |