Mirror of the Vim source from https://github.com/vim/vim
Revision | 7fe13e0f5dce15cd16dd61c898e63899a9aff561 (tree) |
---|---|
Zeit | 2005-12-23 07:47:02 |
Autor | vimboss |
Commiter | vimboss |
updated for version 7.0175
@@ -1777,7 +1777,7 @@ | ||
1777 | 1777 | |
1778 | 1778 | " set up redirection |
1779 | 1779 | if &srr =~ "%s" |
1780 | - let redir= substitute(&srr,"%s","/dev/null"."") | |
1780 | + let redir= substitute(&srr,"%s","/dev/null","") | |
1781 | 1781 | else |
1782 | 1782 | let redir= &srr . "/dev/null" |
1783 | 1783 | endif |
@@ -2206,6 +2206,8 @@ | ||
2206 | 2206 | #group#event#pattern |
2207 | 2207 | autocommand defined for this group, |
2208 | 2208 | event and pattern. |
2209 | + ##event autocommand for this event is | |
2210 | + supported. | |
2209 | 2211 | For checking for a supported feature use |has()|. |
2210 | 2212 | |
2211 | 2213 | Examples: > |
@@ -2220,6 +2222,7 @@ | ||
2220 | 2222 | exists("#filetypeindent") |
2221 | 2223 | exists("#filetypeindent#FileType") |
2222 | 2224 | exists("#filetypeindent#FileType#*") |
2225 | + exists("##ColorScheme") | |
2223 | 2226 | < There must be no space between the symbol (&/$/*/#) and the |
2224 | 2227 | name. |
2225 | 2228 | Note that the argument must be a string, not the name of the |
@@ -1,4 +1,4 @@ | ||
1 | -*todo.txt* For Vim version 7.0aa. Last change: 2005 Dec 19 | |
1 | +*todo.txt* For Vim version 7.0aa. Last change: 2005 Dec 22 | |
2 | 2 | |
3 | 3 | |
4 | 4 | VIM REFERENCE MANUAL by Bram Moolenaar |
@@ -30,6 +30,13 @@ | ||
30 | 30 | *known-bugs* |
31 | 31 | -------------------- Known bugs and current work ----------------------- |
32 | 32 | |
33 | +ln -s b a | |
34 | +vim a | |
35 | +[insert some text] | |
36 | +:w | |
37 | +:sp b | |
38 | +[there are now two buffers for the same file and two swapfiles] | |
39 | + | |
33 | 40 | ccomplete: |
34 | 41 | - When an option is set: In completion mode and the user types (identifier) |
35 | 42 | characters, advance to the first match instead of removing the popup menu. |
@@ -93,6 +100,9 @@ | ||
93 | 100 | Win32: Use the free downloadable compiler 7.1. Figure out how to do debugging |
94 | 101 | (with Agide?) and describe it. (George Reilly) |
95 | 102 | Try out using the free MS compiler and debugger, using Make_mvc.mak. |
103 | +Try using Visual C++ Express 2005. (Ilya Bobir Dec 20) | |
104 | + Disadvantage: Annoying warning messages, requires ..._NO_DEPRECATE, this | |
105 | + is not a standard compiler. | |
96 | 106 | |
97 | 107 | Win32: Check that installer puts menu items in "all users" dir when possible, |
98 | 108 | not administrator dir. |
@@ -1,4 +1,4 @@ | ||
1 | -*version7.txt* For Vim version 7.0aa. Last change: 2005 Dec 19 | |
1 | +*version7.txt* For Vim version 7.0aa. Last change: 2005 Dec 20 | |
2 | 2 | |
3 | 3 | |
4 | 4 | VIM REFERENCE MANUAL by Bram Moolenaar |
@@ -916,8 +916,8 @@ | ||
916 | 916 | inserted after the CTRL-O. Allows using CTRL-O commands to move the cursor |
917 | 917 | without losing the last inserted text. |
918 | 918 | |
919 | -The exists() function now supports checking for autocmd group definition. | |
920 | -(Yegappan Lakshmanan) | |
919 | +The exists() function now supports checking for autocmd group definition | |
920 | +and for supported autocommands. (Yegappan Lakshmanan) | |
921 | 921 | |
922 | 922 | ============================================================================== |
923 | 923 | COMPILE TIME CHANGES *compile-changes-7* |
@@ -1509,4 +1509,7 @@ | ||
1509 | 1509 | appear in the register. Now the CursorHold event is not triggered while |
1510 | 1510 | recording. |
1511 | 1511 | |
1512 | +Unix: the src/configure script used ${srcdir-.}, not all shells understand | |
1513 | +that. Use ${srcdir:-.} instead. | |
1514 | + | |
1512 | 1515 | vim:tw=78:ts=8:ft=help:norl: |
@@ -16,8 +16,7 @@ | ||
16 | 16 | $VIM -u NONE -e -c "mkspell! $SPELLDIR/fo fo_FO" -c q |
17 | 17 | |
18 | 18 | $SPELLDIR/fo.utf-8.spl : $FILES |
19 | - :sys env LANG=fo_FO.UTF-8 | |
20 | - $VIM -u NONE -e -c "mkspell! $SPELLDIR/fo fo_FO" -c q | |
19 | + :sys $VIM -u NONE -e -c "set enc=utf-8" -c "mkspell! $SPELLDIR/fo fo_FO" -c q | |
21 | 20 | |
22 | 21 | ../README_fo.txt : README_fo_FO.txt Copyright |
23 | 22 | :cat $source >! $target |
@@ -16,8 +16,7 @@ | ||
16 | 16 | $VIM -u NONE -e -c "mkspell! $SPELLDIR/gd gd_GB" -c q |
17 | 17 | |
18 | 18 | $SPELLDIR/gd.utf-8.spl : $FILES |
19 | - :sys env LANG=gd_GB.UTF-8 | |
20 | - $VIM -u NONE -e -c "mkspell! $SPELLDIR/gd gd_GB" -c q | |
19 | + :sys $VIM -u NONE -e -c "set enc=utf-8" -c "mkspell! $SPELLDIR/gd gd_GB" -c q | |
21 | 20 | |
22 | 21 | ../README_gd.txt : README_gd_GB.txt |
23 | 22 | :copy $source $target |
@@ -12,11 +12,11 @@ | ||
12 | 12 | all: $SPELLDIR/gl.latin1.spl $SPELLDIR/gl.utf-8.spl ../README_gl.txt |
13 | 13 | |
14 | 14 | $SPELLDIR/gl.latin1.spl : $FILES |
15 | - :sys env LANG=gl_ES.ISO8859-1 | |
15 | + :sys env LANG=es_ES.ISO8859-1 | |
16 | 16 | $VIM -u NONE -e -c "mkspell! $SPELLDIR/gl gl_ES" -c q |
17 | 17 | |
18 | 18 | $SPELLDIR/gl.utf-8.spl : $FILES |
19 | - :sys env LANG=gl_ES.UTF-8 | |
19 | + :sys env LANG=es_ES.UTF-8 | |
20 | 20 | $VIM -u NONE -e -c "mkspell! $SPELLDIR/gl gl_ES" -c q |
21 | 21 | |
22 | 22 | ../README_gl.txt : README_gl_ES.txt |
@@ -16,8 +16,7 @@ | ||
16 | 16 | $VIM -u NONE -e -c "mkspell! $SPELLDIR/tl tl_PH" -c q |
17 | 17 | |
18 | 18 | $SPELLDIR/tl.utf-8.spl : $FILES |
19 | - :sys env LANG=tl_PH.UTF-8 | |
20 | - $VIM -u NONE -e -c "mkspell! $SPELLDIR/tl tl_PH" -c q | |
19 | + :sys $VIM -u NONE -e -c "set enc=utf-8" -c "mkspell! $SPELLDIR/tl tl_PH" -c q | |
21 | 20 | |
22 | 21 | ../README_tl.txt : README_tl_PH.txt |
23 | 22 | :copy $source $target |
@@ -1,6 +1,6 @@ | ||
1 | 1 | #! /bin/sh |
2 | 2 | # run the automatically generated configure script |
3 | 3 | CONFIG_STATUS=auto/config.status \ |
4 | - auto/configure "$@" --srcdir="${srcdir-.}" --cache-file=auto/config.cache | |
4 | + auto/configure "$@" --srcdir="${srcdir:-.}" --cache-file=auto/config.cache | |
5 | 5 | # Stupid autoconf 2.5x causes this file to be left behind. |
6 | 6 | if test -f configure.lineno; then rm -f configure.lineno; fi |
@@ -5113,7 +5113,8 @@ | ||
5113 | 5113 | * otherwise CTRL-O w and then <Left> will clear "last_insert". |
5114 | 5114 | */ |
5115 | 5115 | ptr = get_inserted(); |
5116 | - if (did_restart_edit == 0 || (ptr != NULL && STRLEN(ptr) > new_insert_skip)) | |
5116 | + if (did_restart_edit == 0 || (ptr != NULL | |
5117 | + && (int)STRLEN(ptr) > new_insert_skip)) | |
5117 | 5118 | { |
5118 | 5119 | vim_free(last_insert); |
5119 | 5120 | last_insert = ptr; |
@@ -8459,7 +8459,10 @@ | ||
8459 | 8459 | else if (*p == '#') |
8460 | 8460 | { |
8461 | 8461 | #ifdef FEAT_AUTOCMD |
8462 | - n = au_exists(p + 1); | |
8462 | + if (p[1] == '#') | |
8463 | + n = autocmd_supported(p + 2); | |
8464 | + else | |
8465 | + n = au_exists(p + 1); | |
8463 | 8466 | #endif |
8464 | 8467 | } |
8465 | 8468 | else /* internal variable */ |
@@ -8827,6 +8827,18 @@ | ||
8827 | 8827 | #endif /* FEAT_CMDL_COMPL */ |
8828 | 8828 | |
8829 | 8829 | /* |
8830 | + * Return TRUE if autocmd is supported. | |
8831 | + */ | |
8832 | + int | |
8833 | +autocmd_supported(name) | |
8834 | + char_u *name; | |
8835 | +{ | |
8836 | + char_u *p; | |
8837 | + | |
8838 | + return (event_name2nr(name, &p) != NUM_EVENTS); | |
8839 | +} | |
8840 | + | |
8841 | +/* | |
8830 | 8842 | * Return TRUE if an autocommand is defined for a group, event and |
8831 | 8843 | * pattern: The group can be omitted to accept any group. "event" and "pattern" |
8832 | 8844 | * can be NULL to accept any event and pattern. "pattern" can be NULL to accept |
@@ -8852,11 +8864,11 @@ | ||
8852 | 8864 | int group; |
8853 | 8865 | int retval = FALSE; |
8854 | 8866 | |
8855 | - /* Make a copy so that we can change the '#' to a NUL. */ | |
8867 | + /* Make a copy so that we can change the '#' chars to a NUL. */ | |
8856 | 8868 | arg_save = vim_strsave(arg); |
8857 | 8869 | if (arg_save == NULL) |
8858 | 8870 | return FALSE; |
8859 | - p = vim_strchr(arg, '#'); | |
8871 | + p = vim_strchr(arg_save, '#'); | |
8860 | 8872 | if (p != NULL) |
8861 | 8873 | *p++ = NUL; |
8862 | 8874 |
@@ -2522,8 +2522,7 @@ | ||
2522 | 2522 | |
2523 | 2523 | #define add_string(s) strcpy((LPSTR)p, s); (LPSTR)p += (strlen((LPSTR)p) + 1) |
2524 | 2524 | #define add_word(x) *p++ = (x) |
2525 | -#define add_byte(x) *((LPSTR)p)++ = (x) | |
2526 | -#define add_long(x) *((LPDWORD)p)++ = (x) | |
2525 | +#define add_long(x) dwp = (DWORD *)p; *dwp++ = (x); p = (WORD *)dwp | |
2527 | 2526 | |
2528 | 2527 | #if defined(FEAT_GUI_DIALOG) || defined(PROTO) |
2529 | 2528 | /* |
@@ -2650,6 +2649,7 @@ | ||
2650 | 2649 | char_u *textfield) |
2651 | 2650 | { |
2652 | 2651 | WORD *p, *pdlgtemplate, *pnumitems; |
2652 | + DWORD *dwp; | |
2653 | 2653 | int numButtons; |
2654 | 2654 | int *buttonWidths, *buttonPositions; |
2655 | 2655 | int buttonYpos; |
@@ -722,6 +722,10 @@ | ||
722 | 722 | { |
723 | 723 | int size = vim_strsize(s); |
724 | 724 | |
725 | + /* There may be room anyway when there are multibyte chars. */ | |
726 | + if (size <= room) | |
727 | + return s; | |
728 | + | |
725 | 729 | for (n = 0; size >= room; ) |
726 | 730 | { |
727 | 731 | size -= (*mb_ptr2cells)(s + n); |
@@ -41,6 +41,7 @@ | ||
41 | 41 | char_u *get_augroup_name __ARGS((expand_T *xp, int idx)); |
42 | 42 | char_u *set_context_in_autocmd __ARGS((expand_T *xp, char_u *arg, int doautocmd)); |
43 | 43 | char_u *get_event_name __ARGS((expand_T *xp, int idx)); |
44 | +int autocmd_supported __ARGS((char_u *name)); | |
44 | 45 | int au_exists __ARGS((char_u *arg)); |
45 | 46 | int match_file_pat __ARGS((char_u *pattern, regprog_T *prog, char_u *fname, char_u *sfname, char_u *tail, int allow_dirs)); |
46 | 47 | int match_file_list __ARGS((char_u *list, char_u *sfname, char_u *ffname)); |
@@ -24,7 +24,7 @@ | ||
24 | 24 | test38.out test39.out test40.out test41.out test42.out \ |
25 | 25 | test43.out test44.out test45.out test46.out test47.out \ |
26 | 26 | test48.out test51.out test53.out test54.out test55.out \ |
27 | - test56.out test57.out test58.out test59.out | |
27 | + test56.out test57.out test58.out test59.out test60.out | |
28 | 28 | |
29 | 29 | .SUFFIXES: .in .out |
30 | 30 |
@@ -25,7 +25,7 @@ | ||
25 | 25 | test15.out test17.out test18.out test21.out test26.out \ |
26 | 26 | test30.out test31.out test32.out test33.out test34.out \ |
27 | 27 | test37.out test38.out test39.out test40.out test41.out \ |
28 | - test42.out test52.out | |
28 | + test42.out test52.out test60.out | |
29 | 29 | |
30 | 30 | SCRIPTS32 = test50.out |
31 | 31 |
@@ -24,7 +24,7 @@ | ||
24 | 24 | test38.out test39.out test40.out test41.out test42.out \ |
25 | 25 | test43.out test44.out test45.out test46.out test47.out \ |
26 | 26 | test48.out test51.out test53.out test54.out test55.out \ |
27 | - test56.out test57.out test58.out test59.out | |
27 | + test56.out test57.out test58.out test59.out test60.out | |
28 | 28 | |
29 | 29 | .SUFFIXES: .in .out |
30 | 30 |
@@ -58,7 +58,7 @@ | ||
58 | 58 | test38.out test39.out test40.out test41.out test42.out \ |
59 | 59 | test43.out test44.out test45.out test46.out \ |
60 | 60 | test48.out test51.out test53.out test54.out test55.out \ |
61 | - test56.out test57.out test58.out test59.out | |
61 | + test56.out test57.out test58.out test59.out test60.out | |
62 | 62 | |
63 | 63 | .IFDEF WANT_GUI |
64 | 64 | SCRIPT_GUI = test16.out |
@@ -15,7 +15,7 @@ | ||
15 | 15 | test43.out test44.out test45.out test46.out test47.out \ |
16 | 16 | test48.out test49.out test51.out test52.out test53.out \ |
17 | 17 | test54.out test55.out test56.out test57.out test58.out \ |
18 | - test59.out | |
18 | + test59.out test60.out | |
19 | 19 | |
20 | 20 | SCRIPTS_GUI = test16.out |
21 | 21 |
@@ -0,0 +1,71 @@ | ||
1 | +Tests for the exists() function. vim: set ft=vim : | |
2 | + | |
3 | +STARTTEST | |
4 | +:so small.vim | |
5 | +:function! RunTest(str, result) | |
6 | + if exists(a:str) == a:result | |
7 | + echo "OK" | |
8 | + else | |
9 | + echo "FAILED: Checking for " . a:str | |
10 | + endif | |
11 | +endfunction | |
12 | +:function! TestExists() | |
13 | + augroup myagroup | |
14 | + autocmd! BufEnter *.my echo 'myfile edited' | |
15 | + augroup END | |
16 | + redir! > test.out | |
17 | + | |
18 | + " valid autocmd group | |
19 | + call RunTest('#myagroup', 1) | |
20 | + | |
21 | + " Valid autocmd group and event | |
22 | + call RunTest('#myagroup#BufEnter', 1) | |
23 | + | |
24 | + " Valid autocmd group, event and pattern | |
25 | + call RunTest('#myagroup#BufEnter#*.my', 1) | |
26 | + | |
27 | + " Valid autocmd event | |
28 | + call RunTest('#BufEnter', 1) | |
29 | + | |
30 | + " Valid autocmd event and pattern | |
31 | + call RunTest('#BufEnter#*.my', 1) | |
32 | + | |
33 | + " Non-existing autocmd group or event | |
34 | + call RunTest('#xyzagroup', 0) | |
35 | + | |
36 | + " Non-existing autocmd group and valid autocmd event | |
37 | + call RunTest('#xyzagroup#BufEnter', 0) | |
38 | + | |
39 | + " Valid autocmd group and autocmd event with no matching pattern | |
40 | + call RunTest('#myagroup#CmdwinEnter', 0) | |
41 | + | |
42 | + " Valid autocmd group and non-existing autocmd event | |
43 | + call RunTest('#myagroup#xyzacmd', 0) | |
44 | + | |
45 | + " Valid autocmd group and event and non-matching pattern | |
46 | + call RunTest('#myagroup#BufEnter#xyzpat', 0) | |
47 | + | |
48 | + " Valid autocmd event and non-matching pattern | |
49 | + call RunTest('#BufEnter#xyzpat', 0) | |
50 | + | |
51 | + " Empty autocmd group, event and pattern | |
52 | + call RunTest('###', 0) | |
53 | + | |
54 | + " Empty autocmd group and event or event and pattern | |
55 | + call RunTest('##', 0) | |
56 | + | |
57 | + " Testing support for event name that exists. | |
58 | + call RunTest('##SwapExists', 1) | |
59 | + | |
60 | + " Testing support for event name that doesn't exist. | |
61 | + call RunTest('##SwapNotExists', 0) | |
62 | + | |
63 | + redir END | |
64 | +endfunction | |
65 | +:call TestExists() | |
66 | +:edit! test.out | |
67 | +:set ff=unix | |
68 | +:w | |
69 | +:qa! | |
70 | +ENDTEST | |
71 | + |
@@ -0,0 +1,16 @@ | ||
1 | + | |
2 | +OK | |
3 | +OK | |
4 | +OK | |
5 | +OK | |
6 | +OK | |
7 | +OK | |
8 | +OK | |
9 | +OK | |
10 | +OK | |
11 | +OK | |
12 | +OK | |
13 | +OK | |
14 | +OK | |
15 | +OK | |
16 | +OK |
@@ -1082,7 +1082,7 @@ | ||
1082 | 1082 | |
1083 | 1083 | /* Show the sponsor and register message one out of four times, the Uganda |
1084 | 1084 | * message two out of four times. */ |
1085 | - sponsor = time(NULL); | |
1085 | + sponsor = (int)time(NULL); | |
1086 | 1086 | sponsor = ((sponsor & 2) == 0) - ((sponsor & 4) == 0); |
1087 | 1087 | |
1088 | 1088 | /* start displaying the message lines after half of the blank lines */ |
@@ -36,5 +36,5 @@ | ||
36 | 36 | #define VIM_VERSION_NODOT "vim70aa" |
37 | 37 | #define VIM_VERSION_SHORT "7.0aa" |
38 | 38 | #define VIM_VERSION_MEDIUM "7.0aa ALPHA" |
39 | -#define VIM_VERSION_LONG "VIM - Vi IMproved 7.0aa ALPHA (2005 Dec 19)" | |
40 | -#define VIM_VERSION_LONG_DATE "VIM - Vi IMproved 7.0aa ALPHA (2005 Dec 19, compiled " | |
39 | +#define VIM_VERSION_LONG "VIM - Vi IMproved 7.0aa ALPHA (2005 Dec 22)" | |
40 | +#define VIM_VERSION_LONG_DATE "VIM - Vi IMproved 7.0aa ALPHA (2005 Dec 22, compiled " |