]> granicus.if.org Git - vim/commitdiff
updated for version 7.0106
authorBram Moolenaar <Bram@vim.org>
Sat, 9 Jul 2005 21:03:22 +0000 (21:03 +0000)
committerBram Moolenaar <Bram@vim.org>
Sat, 9 Jul 2005 21:03:22 +0000 (21:03 +0000)
runtime/doc/map.txt
src/ex_docmd.c
src/gui_at_fs.c
src/os_vms.c
src/os_win32.c
src/po/Make_cyg.mak
src/vim.h

index 18da9ccc069fe2558a94faeb6846cb41be9166a6..a42b744afcff80c110ea8fc1fe3f6267ef78af90 100644 (file)
@@ -932,26 +932,36 @@ completion can be enabled:
        -complete=tag_listfiles tags, file names are shown when CTRL-D is hit
        -complete=var           user variables
        -complete=custom,{func} custom completion, defined via {func}
+       -complete=customlist,{func} custom completion, defined via {func}
 
 Custom completion                          *:command-completion-custom*
                                                        *E467* *E468*
 It is possible to define customized completion schemes via the "custom,{func}"
-completion argument.  The {func} part should be a function with the following
-prototype >
+or the "customlist,{func}" completion argument.  The {func} part should be a
+function with the following prototype >
 
        :function {func}(ArgLead, CmdLine, CursorPos)
 
-The function need not use all these arguments, but it should provide the
-completion candidates as the return value, one per line in a newline separated
-string.  The function arguments are:
+The function need not use all these arguments. The function should provide the
+completion candidates as the return value.
+
+For the "custom" argument, the function should return the completion
+candidates one per line in a newline separated string.
+
+For the "customlist" argument, the function should return the completion
+candidates as a Vim List. Non-string items in the list are ignored.
+
+The function arguments are:
        ArgLead         the leading portion of the argument currently being
                        completed on
        CmdLine         the entire command line
        CursorPos       the cursor position in it
-The function may use these for determining context.  It is not necessary to
-filter candidates against the (implicit pattern in) ArgLead.  Vim will do
-filter the candidates with its regexp engine after function return, and this
-is probably more efficient in most cases.
+The function may use these for determining context.  For the "custom"
+argument, it is not necessary to filter candidates against the (implicit
+pattern in) ArgLead.  Vim will do filter the candidates with its regexp engine
+after function return, and this is probably more efficient in most cases. For
+the "customlist" argument, Vim will not filter the returned completion
+candidates and the user supplied function should filter the candidates.
 
 The following example lists user names to a Finger command >
     :com -complete=custom,ListUsers -nargs=1 Finger !finger <args>
@@ -959,6 +969,14 @@ The following example lists user names to a Finger command >
     :    return system("cut -d: -f1 /etc/passwd")
     :endfun
 
+The following example completes filenames from the directories specified in
+the 'path' option: >
+    :com -nargs=1 -bang -complete=customlist,EditFileComplete
+                       \ EditFile edit<bang> <args>
+    :fun EditFileComplete(A,L,P)
+    :    return split(globpath(&path, a:ArgLead))
+    :endfun
+<
 Range handling                                         *E177* *E178*
 
 By default, user-defined commands do not accept a line number range.  However,
index ebfac55fd7e2a6dda57393204e5bb97544f92b11..4a83ca0134a995fd647912b1b18096286e236cc6 100644 (file)
@@ -3252,7 +3252,7 @@ set_one_cmd_context(xp, buff)
                ++xp->xp_pattern;
 #if defined(FEAT_USR_CMDS) && defined(FEAT_CMDL_COMPL)
                /* Avoid that the assignment uses EXPAND_FILES again. */
-               if (compl != EXPAND_USER_DEFINED)
+               if (compl != EXPAND_USER_DEFINED && compl != EXPAND_USER_LIST)
                    compl = EXPAND_ENV_VARS;
 #endif
            }
@@ -4992,6 +4992,7 @@ static struct
     {EXPAND_COMMANDS, "command"},
 #if defined(FEAT_EVAL) && defined(FEAT_CMDL_COMPL)
     {EXPAND_USER_DEFINED, "custom"},
+    {EXPAND_USER_LIST, "customlist"},
 #endif
     {EXPAND_DIRECTORIES, "dir"},
     {EXPAND_ENV_VARS, "environment"},
@@ -5301,7 +5302,8 @@ invalid_count:
                return FAIL;
            }
 #if defined(FEAT_EVAL) && defined(FEAT_CMDL_COMPL)
-           if (*compl != EXPAND_USER_DEFINED && arg != NULL)
+           if (*compl != EXPAND_USER_DEFINED && *compl != EXPAND_USER_LIST &&
+               arg != NULL)
 #else
            if (arg != NULL)
 #endif
@@ -5310,7 +5312,8 @@ invalid_count:
                return FAIL;
            }
 #if defined(FEAT_EVAL) && defined(FEAT_CMDL_COMPL)
-           if (*compl == EXPAND_USER_DEFINED && arg == NULL)
+           if ((*compl == EXPAND_USER_DEFINED || *compl == EXPAND_USER_LIST) &&
+               arg == NULL)
            {
                EMSG(_("E467: Custom completion requires a function argument"));
                return FAIL;
index 474967ecbf07b6a17ab1d3b417823a88689f5aae..3ded711522c37243a8588f6c64283a0c113ec257 100644 (file)
@@ -2855,7 +2855,7 @@ vim_SelFile(toplevel, prompt, init_path, show_entry, x, y, fg, bg, scroll_fg, sc
     SFdirModTimerId = XtAppAddTimeOut(SFapp, (unsigned long) 1000,
            SFdirModTimer, (XtPointer) NULL);
 
-    while (1)
+    for (;;)
     {
        XtAppNextEvent(SFapp, &event);
        XtDispatchEvent(&event);
index 6fd05d5038605bd9dae8c52a6fccde4927e15f06..ff3bf2c162a86dfed6a6fb6bde36b5f08f28c1e3 100644 (file)
@@ -317,7 +317,7 @@ vms_read(char *inbuf, size_t nbytes)
     function = (IO$_READLBLK | IO$M_EXTEND);
     memset(inbuf, 0, nbytes);
 
-    while (1)
+    for (;;)
     {
        status = sys$qiow(0, iochan, function, &iosb, 0, 0, inbuf, nbytes - 1,
                                               0, 0, &itmlst, sizeof(itmlst));
index 77a96c949b613d3e3942299cc9a6a096ac1fd8c8..6ad674e2df9a1d13784a15bf1bfc937aaacc37f9 100644 (file)
@@ -4828,7 +4828,7 @@ myresetstkoflw(void)
         * committed block. */
        BYTE *pBlock = pStackBase;
 
-       while (1)
+       for (;;)
        {
            if (VirtualQuery(pBlock, &mbi, sizeof mbi) == 0)
                return 0;
index f39368f9e4715d9a62f110d2ca2be995774461ea..e306ccb9ed2ec456147a42d95be52976da7307bb 100644 (file)
@@ -13,10 +13,12 @@ VIMRUNTIME = ../../runtime
 endif
 
 LANGUAGES =    af ca cs de en_GB es fr ga it ja ko no pl ru sk sv uk vi zh_TW \
-               zh_TW.UTF-8 zh_CN zh_CN.UTF-8
+               cs.cp1250 ja.sjis pl.cp1250 ru.cp1251 sk.cp1250 uk.cp1251 \
+               zh_TW.UTF-8 zh_CN zh_CN.cp936 zh_CN.UTF-8
 MOFILES =      af.mo ca.mo cs.mo de.mo en_GB.mo es.mo fr.mo ga.mo it.mo ja.mo \
                ko.mo no.mo pl.mo ru.mo sk.mo sv.mo uk.mo vi.mo \
-               zh_TW.mo zh_TW.UTF-8.mo zh_CN.mo zh_CN.UTF-8.mo
+               cs.cp1250.mo ja.sjis.mo pl.cp1250.mo ru.cp1251.mo sk.cp1250.mo uk.cp1251.mo \
+               zh_TW.mo zh_TW.UTF-8.mo zh_CN.mo zh_CN.cp936.mo zh_CN.UTF-8.mo
 
 PACKAGE = vim
 
index c8a4b63981c1aba9b55d786066d337ac19091429..20273b3963dc2ad3c2dedfdb40db8f7e9763b135 100644 (file)
--- a/src/vim.h
+++ b/src/vim.h
@@ -648,6 +648,7 @@ extern char *(*dyn_libintl_textdomain)(const char *domainname);
 #define EXPAND_COLORS          28
 #define EXPAND_COMPILER                29
 #define EXPAND_USER_DEFINED    30
+#define EXPAND_USER_LIST       31
 
 /* Values for exmode_active (0 is no exmode) */
 #define EXMODE_NORMAL          1