]> granicus.if.org Git - vim/commitdiff
updated for version 7.0175 v7.0175
authorBram Moolenaar <Bram@vim.org>
Thu, 22 Dec 2005 22:47:02 +0000 (22:47 +0000)
committerBram Moolenaar <Bram@vim.org>
Thu, 22 Dec 2005 22:47:02 +0000 (22:47 +0000)
24 files changed:
runtime/autoload/netrw.vim
runtime/doc/eval.txt
runtime/doc/todo.txt
runtime/doc/version7.txt
runtime/spell/fo/main.aap
runtime/spell/gd/main.aap
runtime/spell/gl/main.aap
runtime/spell/tl/main.aap
src/configure
src/edit.c
src/eval.c
src/fileio.c
src/gui_w32.c
src/message.c
src/proto/fileio.pro
src/testdir/Make_amiga.mak
src/testdir/Make_dos.mak
src/testdir/Make_os2.mak
src/testdir/Make_vms.mms
src/testdir/Makefile
src/testdir/test60.in [new file with mode: 0644]
src/testdir/test60.ok [new file with mode: 0644]
src/version.c
src/version.h

index b7f0c912057b7d683521766a8333b1174c3068b7..bd3e28e2cc8469308bb9907ab8fba0a2ac3a5be8 100644 (file)
@@ -1777,7 +1777,7 @@ fun! s:NetBrowseX(fname,remote)
 
   " set up redirection
   if &srr =~ "%s"
-   let redir= substitute(&srr,"%s","/dev/null"."")
+   let redir= substitute(&srr,"%s","/dev/null","")
   else
    let redir= &srr . "/dev/null"
   endif
index 47be23fc2da307a467ef81c26dbbeabff3c23b4b..50cbec9b63d4152ca5c7ed4f4357c0de1ddb6f04 100644 (file)
@@ -2206,6 +2206,8 @@ exists({expr})    The result is a Number, which is non-zero if {expr} is
                        #group#event#pattern
                                        autocommand defined for this group, 
                                        event and pattern.
+                       ##event         autocommand for this event is
+                                       supported.
                For checking for a supported feature use |has()|.
 
                Examples: >
@@ -2220,6 +2222,7 @@ exists({expr})    The result is a Number, which is non-zero if {expr} is
                        exists("#filetypeindent")
                        exists("#filetypeindent#FileType")
                        exists("#filetypeindent#FileType#*")
+                       exists("##ColorScheme")
 <              There must be no space between the symbol (&/$/*/#) and the
                name.
                Note that the argument must be a string, not the name of the
index 30bc26d2bcf26cb0e40ee23bf041a3a321a8445b..ff1f0f46d45fd13adcdc949e91f0fdcd868929d6 100644 (file)
@@ -1,4 +1,4 @@
-*todo.txt*      For Vim version 7.0aa.  Last change: 2005 Dec 19
+*todo.txt*      For Vim version 7.0aa.  Last change: 2005 Dec 22
 
 
                  VIM REFERENCE MANUAL    by Bram Moolenaar
@@ -30,6 +30,13 @@ be worked on, but only if you sponsor Vim development.  See |sponsor|.
                                                        *known-bugs*
 -------------------- Known bugs and current work -----------------------
 
+ln -s b a
+vim a
+[insert some text]
+:w
+:sp b
+[there are now two buffers for the same file and two swapfiles]
+
 ccomplete:
 - When an option is set: In completion mode and the user types (identifier)
   characters, advance to the first match instead of removing the popup menu.
@@ -93,6 +100,9 @@ Also add search???() function that returns list with lnum and col.
 Win32: Use the free downloadable compiler 7.1.  Figure out how to do debugging
 (with Agide?) and describe it. (George Reilly)
 Try out using the free MS compiler and debugger, using Make_mvc.mak.
+Try using Visual C++ Express 2005. (Ilya Bobir Dec 20)
+    Disadvantage: Annoying warning messages, requires ..._NO_DEPRECATE, this
+    is not a standard compiler.
 
 Win32: Check that installer puts menu items in "all users" dir when possible,
 not administrator dir.
index 474647d5ac3007c234c52aa6acbc84e4b48b13f4..0be816d521967457516ce3bcdbd45ca06931a33a 100644 (file)
@@ -1,4 +1,4 @@
-*version7.txt*  For Vim version 7.0aa.  Last change: 2005 Dec 19
+*version7.txt*  For Vim version 7.0aa.  Last change: 2005 Dec 20
 
 
                  VIM REFERENCE MANUAL    by Bram Moolenaar
@@ -916,8 +916,8 @@ then a cursor key.  Now keep the previously inserted text if nothing is
 inserted after the CTRL-O.  Allows using CTRL-O commands to move the cursor
 without losing the last inserted text.
 
-The exists() function now supports checking for autocmd group definition.
-(Yegappan Lakshmanan)
+The exists() function now supports checking for autocmd group definition
+and for supported autocommands. (Yegappan Lakshmanan)
 
 ==============================================================================
 COMPILE TIME CHANGES                                   *compile-changes-7*
@@ -1509,4 +1509,7 @@ When recording while a CursorHold autocommand was defined special keys would
 appear in the register.  Now the CursorHold event is not triggered while
 recording.
 
+Unix: the src/configure script used ${srcdir-.}, not all shells understand
+that.  Use ${srcdir:-.} instead.
+
  vim:tw=78:ts=8:ft=help:norl:
index b9be542cf1c41c9befdfec38a79a8568f3b4aa54..9e3eea42eeadaa3dc021bb052ad07538e12a811e 100644 (file)
@@ -16,8 +16,7 @@ $SPELLDIR/fo.latin1.spl : $FILES
                $VIM -u NONE -e -c "mkspell! $SPELLDIR/fo fo_FO" -c q
 
 $SPELLDIR/fo.utf-8.spl : $FILES
-        :sys env LANG=fo_FO.UTF-8
-               $VIM -u NONE -e -c "mkspell! $SPELLDIR/fo fo_FO" -c q
+        :sys $VIM -u NONE -e -c "set enc=utf-8" -c "mkspell! $SPELLDIR/fo fo_FO" -c q
 
 ../README_fo.txt : README_fo_FO.txt Copyright
         :cat $source >! $target
index 8992f032c005f747dec4381f2de744dfe9a2d680..658cbfc0574517e053c3f7b3479118b1f287ba68 100644 (file)
@@ -16,8 +16,7 @@ $SPELLDIR/gd.latin1.spl : $FILES
                $VIM -u NONE -e -c "mkspell! $SPELLDIR/gd gd_GB" -c q
 
 $SPELLDIR/gd.utf-8.spl : $FILES
-        :sys env LANG=gd_GB.UTF-8
-               $VIM -u NONE -e -c "mkspell! $SPELLDIR/gd gd_GB" -c q
+        :sys $VIM -u NONE -e -c "set enc=utf-8" -c "mkspell! $SPELLDIR/gd gd_GB" -c q
 
 ../README_gd.txt : README_gd_GB.txt
         :copy $source $target
index 2fc012aa318cd47c07a113f650bbafe22333026b..504fda0ef5cdde02a3f37e097c07f762a075a7a0 100644 (file)
@@ -12,11 +12,11 @@ FILES    = gl_ES.aff gl_ES.dic
 all: $SPELLDIR/gl.latin1.spl $SPELLDIR/gl.utf-8.spl ../README_gl.txt
 
 $SPELLDIR/gl.latin1.spl : $FILES
-        :sys env LANG=gl_ES.ISO8859-1
+        :sys env LANG=es_ES.ISO8859-1
                $VIM -u NONE -e -c "mkspell! $SPELLDIR/gl gl_ES" -c q
 
 $SPELLDIR/gl.utf-8.spl : $FILES
-        :sys env LANG=gl_ES.UTF-8
+        :sys env LANG=es_ES.UTF-8
                $VIM -u NONE -e -c "mkspell! $SPELLDIR/gl gl_ES" -c q
 
 ../README_gl.txt : README_gl_ES.txt
index 0145e4abc5e5c25d477e239470c3322f008626e7..49d86ac08f525c8f25a83598ded76e608949e2e0 100644 (file)
@@ -16,8 +16,7 @@ $SPELLDIR/tl.latin1.spl : $FILES
                $VIM -u NONE -e -c "mkspell! $SPELLDIR/tl tl_PH" -c q
 
 $SPELLDIR/tl.utf-8.spl : $FILES
-        :sys env LANG=tl_PH.UTF-8
-               $VIM -u NONE -e -c "mkspell! $SPELLDIR/tl tl_PH" -c q
+        :sys $VIM -u NONE -e -c "set enc=utf-8" -c "mkspell! $SPELLDIR/tl tl_PH" -c q
 
 ../README_tl.txt : README_tl_PH.txt
         :copy $source $target
index 6aa15be9c36b998fd977472c05bf3216d1beea57..f9f65fa36cf347fb6c682bd609d8dc8a6bf0f8e5 100755 (executable)
@@ -1,6 +1,6 @@
 #! /bin/sh
 # run the automatically generated configure script
 CONFIG_STATUS=auto/config.status \
-       auto/configure "$@" --srcdir="${srcdir-.}" --cache-file=auto/config.cache
+       auto/configure "$@" --srcdir="${srcdir:-.}" --cache-file=auto/config.cache
 # Stupid autoconf 2.5x causes this file to be left behind.
 if test -f configure.lineno; then rm -f configure.lineno; fi
index f4f3f9a77092f46e6daf3046a4a7b677da6d6934..c21c7e3fbefbeef3d55593b45895af1f6aa94864 100644 (file)
@@ -5113,7 +5113,8 @@ stop_insert(end_insert_pos, esc)
      * otherwise CTRL-O w and then <Left> will clear "last_insert".
      */
     ptr = get_inserted();
-    if (did_restart_edit == 0 || (ptr != NULL && STRLEN(ptr) > new_insert_skip))
+    if (did_restart_edit == 0 || (ptr != NULL
+                                      && (int)STRLEN(ptr) > new_insert_skip))
     {
        vim_free(last_insert);
        last_insert = ptr;
index e6e712bdf19fd41a06baa1b107db87b6b810d807..eef865a4bddadecef5f305cf27268ca81a0b5b84 100644 (file)
@@ -8459,7 +8459,10 @@ f_exists(argvars, rettv)
     else if (*p == '#')
     {
 #ifdef FEAT_AUTOCMD
-       n = au_exists(p + 1);
+       if (p[1] == '#')
+           n = autocmd_supported(p + 2);
+       else
+           n = au_exists(p + 1);
 #endif
     }
     else                               /* internal variable */
index 2f93f53e8c0b4815489f345e0b907601350741e3..1ff4e4609527580dda90846c68214815c0ecae20 100644 (file)
@@ -8826,6 +8826,18 @@ get_event_name(xp, idx)
 
 #endif /* FEAT_CMDL_COMPL */
 
+/*
+ * Return TRUE if autocmd is supported.
+ */
+    int
+autocmd_supported(name)
+    char_u     *name;
+{
+    char_u *p;
+
+    return (event_name2nr(name, &p) != NUM_EVENTS);
+}
+
 /*
  * Return TRUE if an autocommand is defined for a group, event and
  * pattern:  The group can be omitted to accept any group. "event" and "pattern"
@@ -8852,11 +8864,11 @@ au_exists(arg)
     int                group;
     int                retval = FALSE;
 
-    /* Make a copy so that we can change the '#' to a NUL. */
+    /* Make a copy so that we can change the '#' chars to a NUL. */
     arg_save = vim_strsave(arg);
     if (arg_save == NULL)
        return FALSE;
-    p = vim_strchr(arg, '#');
+    p = vim_strchr(arg_save, '#');
     if (p != NULL)
        *p++ = NUL;
 
index c5d1eb009124ce082ba3c05bc64b5e3723f01cf7..c49d82b3e760a34b3e91f45122115cd884afe82e 100644 (file)
@@ -2522,8 +2522,7 @@ gui_mch_menu_grey(
 
 #define add_string(s) strcpy((LPSTR)p, s); (LPSTR)p += (strlen((LPSTR)p) + 1)
 #define add_word(x)            *p++ = (x)
-#define add_byte(x)            *((LPSTR)p)++ = (x)
-#define add_long(x)            *((LPDWORD)p)++ = (x)
+#define add_long(x)            dwp = (DWORD *)p; *dwp++ = (x); p = (WORD *)dwp
 
 #if defined(FEAT_GUI_DIALOG) || defined(PROTO)
 /*
@@ -2650,6 +2649,7 @@ gui_mch_dialog(
     char_u     *textfield)
 {
     WORD       *p, *pdlgtemplate, *pnumitems;
+    DWORD      *dwp;
     int                numButtons;
     int                *buttonWidths, *buttonPositions;
     int                buttonYpos;
index 14786724866b8d3853f417704ea9605e7d6dc4e6..8ea49ae2003a69df35f88e4f604301944c406fa5 100644 (file)
@@ -722,6 +722,10 @@ msg_may_trunc(force, s)
        {
            int size = vim_strsize(s);
 
+           /* There may be room anyway when there are multibyte chars. */
+           if (size <= room)
+               return s;
+
            for (n = 0; size >= room; )
            {
                size -= (*mb_ptr2cells)(s + n);
index 816de42cb5f3e4a148f893f3d2007bc0fd8b897b..52ae6424e82b370ad3a469b9120a5daa3f89405d 100644 (file)
@@ -41,6 +41,7 @@ int has_autocmd __ARGS((EVENT_T event, char_u *sfname, buf_T *buf));
 char_u *get_augroup_name __ARGS((expand_T *xp, int idx));
 char_u *set_context_in_autocmd __ARGS((expand_T *xp, char_u *arg, int doautocmd));
 char_u *get_event_name __ARGS((expand_T *xp, int idx));
+int autocmd_supported __ARGS((char_u *name));
 int au_exists __ARGS((char_u *arg));
 int match_file_pat __ARGS((char_u *pattern, regprog_T *prog, char_u *fname, char_u *sfname, char_u *tail, int allow_dirs));
 int match_file_list __ARGS((char_u *list, char_u *sfname, char_u *ffname));
index e9e75e517f564825cf9216029880dcf76f4f064d..aee0894fc854c38e69b2f6e063e040179da65215 100644 (file)
@@ -24,7 +24,7 @@ SCRIPTS = test1.out test3.out test4.out test5.out test6.out \
                test38.out test39.out test40.out test41.out test42.out \
                test43.out test44.out test45.out test46.out test47.out \
                test48.out test51.out test53.out test54.out test55.out \
-               test56.out test57.out test58.out test59.out
+               test56.out test57.out test58.out test59.out test60.out
 
 .SUFFIXES: .in .out
 
index 092b24aaca634e885227a3244b62d841a08f946b..1821cca4cab3eddc0c2242a926fd68553bd46d53 100644 (file)
@@ -25,7 +25,7 @@ SCRIPTS =     test3.out test4.out test5.out test6.out test7.out \
                test15.out test17.out test18.out test21.out test26.out \
                test30.out test31.out test32.out test33.out test34.out \
                test37.out test38.out test39.out test40.out test41.out \
-               test42.out test52.out
+               test42.out test52.out test60.out
 
 SCRIPTS32 =    test50.out
 
index 5236922c5ff1f86efa5d31579d0df682eb34d2b5..d8b2f7507c6c1f2ad8a6a164761b8dbc7664cfe9 100644 (file)
@@ -24,7 +24,7 @@ SCRIPTS = test1.out test3.out test4.out test5.out test6.out \
                test38.out test39.out test40.out test41.out test42.out \
                test43.out test44.out test45.out test46.out test47.out \
                test48.out test51.out test53.out test54.out test55.out \
-               test56.out test57.out test58.out test59.out
+               test56.out test57.out test58.out test59.out test60.out
 
 .SUFFIXES: .in .out
 
index 6d08e5041a41ac6e4f952763aaad4a83b1f5162c..767ab7840548e078ba030732c45c5c77568bc276 100644 (file)
@@ -58,7 +58,7 @@ SCRIPT = test1.out  test2.out  test3.out  test4.out  test5.out  \
         test38.out test39.out test40.out test41.out test42.out \
         test43.out test44.out test45.out test46.out \
         test48.out test51.out test53.out test54.out test55.out \
-        test56.out test57.out test58.out test59.out
+        test56.out test57.out test58.out test59.out test60.out
 
 .IFDEF WANT_GUI
 SCRIPT_GUI = test16.out
index 06c4173578be3be75bbb27e012f3c2858ab71d9f..49f14f9f92959bea467d3e4642128608046f36c0 100644 (file)
@@ -15,7 +15,7 @@ SCRIPTS = test1.out test2.out test3.out test4.out test5.out test6.out \
                test43.out test44.out test45.out test46.out test47.out \
                test48.out test49.out test51.out test52.out test53.out \
                test54.out test55.out test56.out test57.out test58.out \
-               test59.out
+               test59.out test60.out
 
 SCRIPTS_GUI = test16.out
 
diff --git a/src/testdir/test60.in b/src/testdir/test60.in
new file mode 100644 (file)
index 0000000..58a2c90
--- /dev/null
@@ -0,0 +1,71 @@
+Tests for the exists() function.  vim: set ft=vim :
+
+STARTTEST
+:so small.vim
+:function! RunTest(str, result)
+    if exists(a:str) == a:result
+       echo "OK"
+    else
+       echo "FAILED: Checking for " . a:str
+    endif
+endfunction
+:function! TestExists()
+    augroup myagroup
+       autocmd! BufEnter *.my echo 'myfile edited'
+    augroup END
+    redir! > test.out
+
+    " valid autocmd group
+    call RunTest('#myagroup', 1)
+
+    " Valid autocmd group and event
+    call RunTest('#myagroup#BufEnter', 1)
+
+    " Valid autocmd group, event and pattern
+    call RunTest('#myagroup#BufEnter#*.my', 1)
+
+    " Valid autocmd event
+    call RunTest('#BufEnter', 1)
+
+    " Valid autocmd event and pattern
+    call RunTest('#BufEnter#*.my', 1)
+
+    " Non-existing autocmd group or event
+    call RunTest('#xyzagroup', 0)
+
+    " Non-existing autocmd group and valid autocmd event
+    call RunTest('#xyzagroup#BufEnter', 0)
+
+    " Valid autocmd group and autocmd event with no matching pattern
+    call RunTest('#myagroup#CmdwinEnter', 0)
+
+    " Valid autocmd group and non-existing autocmd event
+    call RunTest('#myagroup#xyzacmd', 0)
+
+    " Valid autocmd group and event and non-matching pattern
+    call RunTest('#myagroup#BufEnter#xyzpat', 0)
+
+    " Valid autocmd event and non-matching pattern
+    call RunTest('#BufEnter#xyzpat', 0)
+
+    " Empty autocmd group, event and pattern
+    call RunTest('###', 0)
+
+    " Empty autocmd group and event or event and pattern
+    call RunTest('##', 0)
+
+    " Testing support for event name that exists.
+    call RunTest('##SwapExists', 1)
+
+    " Testing support for event name that doesn't exist.
+    call RunTest('##SwapNotExists', 0)
+
+    redir END
+endfunction
+:call TestExists()
+:edit! test.out
+:set ff=unix
+:w
+:qa!
+ENDTEST
+
diff --git a/src/testdir/test60.ok b/src/testdir/test60.ok
new file mode 100644 (file)
index 0000000..004245f
--- /dev/null
@@ -0,0 +1,16 @@
+
+OK
+OK
+OK
+OK
+OK
+OK
+OK
+OK
+OK
+OK
+OK
+OK
+OK
+OK
+OK
index 69a47fff7e18b9e1a1126b2378b988e113c40e31..f14734813a22e9dd0f46d745583fae30b509f23d 100644 (file)
@@ -1082,7 +1082,7 @@ intro_message(colon)
 
     /* Show the sponsor and register message one out of four times, the Uganda
      * message two out of four times. */
-    sponsor = time(NULL);
+    sponsor = (int)time(NULL);
     sponsor = ((sponsor & 2) == 0) - ((sponsor & 4) == 0);
 
     /* start displaying the message lines after half of the blank lines */
index cc5a45b0d865ab402d66e402d3dcb8a587a24bfa..e26c13a8e472758e179e03da9c9da053be6cff94 100644 (file)
@@ -36,5 +36,5 @@
 #define VIM_VERSION_NODOT      "vim70aa"
 #define VIM_VERSION_SHORT      "7.0aa"
 #define VIM_VERSION_MEDIUM     "7.0aa ALPHA"
-#define VIM_VERSION_LONG       "VIM - Vi IMproved 7.0aa ALPHA (2005 Dec 19)"
-#define VIM_VERSION_LONG_DATE  "VIM - Vi IMproved 7.0aa ALPHA (2005 Dec 19, compiled "
+#define VIM_VERSION_LONG       "VIM - Vi IMproved 7.0aa ALPHA (2005 Dec 22)"
+#define VIM_VERSION_LONG_DATE  "VIM - Vi IMproved 7.0aa ALPHA (2005 Dec 22, compiled "