]> granicus.if.org Git - vim/commitdiff
updated for version 7.4.276 v7.4.276
authorBram Moolenaar <Bram@vim.org>
Wed, 7 May 2014 13:10:21 +0000 (15:10 +0200)
committerBram Moolenaar <Bram@vim.org>
Wed, 7 May 2014 13:10:21 +0000 (15:10 +0200)
Problem:    The fish shell is not supported.
Solution:   Use begin/end instead of () for fish. (Andy Russell)

src/ex_cmds.c
src/misc1.c
src/option.c
src/proto/misc1.pro
src/version.c

index 48700f0034cfefc8499fa48b0426f79f25681afa..39f6791b6473c2dcd81cf1f22544efbfc16bf362 100644 (file)
@@ -1551,8 +1551,16 @@ make_filter_cmd(cmd, itmp, otmp)
 {
     char_u     *buf;
     long_u     len;
+    int                is_fish_shell;
 
-    len = (long_u)STRLEN(cmd) + 3;                     /* "()" + NUL */
+#if (defined(UNIX) && !defined(ARCHIE)) || defined(OS2)
+    /* Account for fish's different syntax for subshells */
+    is_fish_shell = (fnamecmp(get_isolated_shell_name(), "fish") == 0);
+    if (is_fish_shell)
+       len = (long_u)STRLEN(cmd) + 13;         /* "begin; " + "; end" + NUL */
+    else
+#endif
+       len = (long_u)STRLEN(cmd) + 3;                  /* "()" + NUL */
     if (itmp != NULL)
        len += (long_u)STRLEN(itmp) + 9;                /* " { < " + " } " */
     if (otmp != NULL)
@@ -1567,7 +1575,12 @@ make_filter_cmd(cmd, itmp, otmp)
      * redirecting input and/or output.
      */
     if (itmp != NULL || otmp != NULL)
-       vim_snprintf((char *)buf, len, "(%s)", (char *)cmd);
+    {
+       if (is_fish_shell)
+           vim_snprintf((char *)buf, len, "begin; %s; end", (char *)cmd);
+       else
+           vim_snprintf((char *)buf, len, "(%s)", (char *)cmd);
+    }
     else
        STRCPY(buf, cmd);
     if (itmp != NULL)
@@ -1577,7 +1590,7 @@ make_filter_cmd(cmd, itmp, otmp)
     }
 #else
     /*
-     * for shells that don't understand braces around commands, at least allow
+     * For shells that don't understand braces around commands, at least allow
      * the use of commands in a pipe.
      */
     STRCPY(buf, cmd);
@@ -4315,7 +4328,7 @@ do_sub(eap)
     pos_T      old_cursor = curwin->w_cursor;
     int                start_nsubs;
 #ifdef FEAT_EVAL
-    int         save_ma = 0;
+    int                save_ma = 0;
 #endif
 
     cmd = eap->arg;
@@ -5986,7 +5999,7 @@ find_help_tags(arg, num_matches, matches, keep_lang)
                               "/\\\\?", "/\\\\z(\\\\)", "\\\\=", ":s\\\\=",
                               "\\[count]", "\\[quotex]", "\\[range]",
                               "\\[pattern]", "\\\\bar", "/\\\\%\\$",
-                               "s/\\\\\\~", "s/\\\\U", "s/\\\\L",
+                              "s/\\\\\\~", "s/\\\\U", "s/\\\\L",
                               "s/\\\\1", "s/\\\\2", "s/\\\\3", "s/\\\\9"};
     int flags;
 
@@ -6026,7 +6039,7 @@ find_help_tags(arg, num_matches, matches, keep_lang)
          /* Replace:
           * "[:...:]" with "\[:...:]"
           * "[++...]" with "\[++...]"
-          * "\{" with "\\{"               -- matching "} \}"
+          * "\{" with "\\{"               -- matching "} \}"
           */
            if ((arg[0] == '[' && (arg[1] == ':'
                         || (arg[1] == '+' && arg[2] == '+')))
index a71ab7cc918dbfad2d615b10bdfdf13fae1d12f9..477aba4bd3b2e0be93b2cbce353799ff085d179e 100644 (file)
@@ -1405,7 +1405,7 @@ open_line(dir, flags, second_line_indent)
 #ifdef FEAT_SMARTINDENT
        if (did_si)
        {
-           int        sw = (int)get_sw_value(curbuf);
+           int sw = (int)get_sw_value(curbuf);
 
            if (p_sr)
                newindent -= newindent % sw;
@@ -10896,3 +10896,41 @@ goto_im()
 {
     return (p_im && stuff_empty() && typebuf_typed());
 }
+
+/*
+ * Returns the isolated name of the shell:
+ * - Skip beyond any path.  E.g., "/usr/bin/csh -f" -> "csh -f".
+ * - Remove any argument.  E.g., "csh -f" -> "csh".
+ * But don't allow a space in the path, so that this works:
+ *   "/usr/bin/csh --rcfile ~/.cshrc"
+ * But don't do that for Windows, it's common to have a space in the path.
+ */
+    char_u *
+get_isolated_shell_name()
+{
+    char_u *p;
+
+#ifdef WIN3264
+    p = gettail(p_sh);
+    p = vim_strnsave(p, (int)(skiptowhite(p) - p));
+#else
+    p = skiptowhite(p_sh);
+    if (*p == NUL)
+    {
+       /* No white space, use the tail. */
+       p = vim_strsave(gettail(p_sh));
+    }
+    else
+    {
+       char_u  *p1, *p2;
+
+       /* Find the last path separator before the space. */
+       p1 = p_sh;
+       for (p2 = p_sh; p2 < p; mb_ptr_adv(p2))
+           if (vim_ispathsep(*p2))
+               p1 = p2 + 1;
+       p = vim_strnsave(p1, (int)(p - p1));
+    }
+#endif
+    return p;
+}
index cbaa763683a7781b771088820c836ffdda1a4917..86e47571c76855fc17613e04bfbc7fffb621e889 100644 (file)
@@ -3804,37 +3804,7 @@ set_init_3()
     else
        do_sp = !(options[idx_sp].flags & P_WAS_SET);
 #endif
-
-    /*
-     * Isolate the name of the shell:
-     * - Skip beyond any path.  E.g., "/usr/bin/csh -f" -> "csh -f".
-     * - Remove any argument.  E.g., "csh -f" -> "csh".
-     * But don't allow a space in the path, so that this works:
-     *   "/usr/bin/csh --rcfile ~/.cshrc"
-     * But don't do that for Windows, it's common to have a space in the path.
-     */
-#ifdef WIN3264
-    p = gettail(p_sh);
-    p = vim_strnsave(p, (int)(skiptowhite(p) - p));
-#else
-    p = skiptowhite(p_sh);
-    if (*p == NUL)
-    {
-       /* No white space, use the tail. */
-       p = vim_strsave(gettail(p_sh));
-    }
-    else
-    {
-       char_u  *p1, *p2;
-
-       /* Find the last path separator before the space. */
-       p1 = p_sh;
-       for (p2 = p_sh; p2 < p; mb_ptr_adv(p2))
-           if (vim_ispathsep(*p2))
-               p1 = p2 + 1;
-       p = vim_strnsave(p1, (int)(p - p1));
-    }
-#endif
+    p = get_isolated_shell_name();
     if (p != NULL)
     {
        /*
@@ -3875,6 +3845,7 @@ set_init_3()
                    || fnamecmp(p, "zsh") == 0
                    || fnamecmp(p, "zsh-beta") == 0
                    || fnamecmp(p, "bash") == 0
+                   || fnamecmp(p, "fish") == 0
 #  ifdef WIN3264
                    || fnamecmp(p, "cmd") == 0
                    || fnamecmp(p, "sh.exe") == 0
@@ -8858,8 +8829,8 @@ get_option_value(name, numval, stringval, opt_flags)
  * opt_type). Uses
  *
  * Returned flags:
- *       0 hidden or unknown option, also option that does not have requested 
- *         type (see SREQ_* in vim.h)
+ *       0 hidden or unknown option, also option that does not have requested
+ *        type (see SREQ_* in vim.h)
  *  see SOPT_* in vim.h for other flags
  *
  * Possible opt_type values: see SREQ_* in vim.h
index 9f986d76ca0805f820753b92c8bdff8e22a41df4..496d2e45a9453a4faa950836696e166897a49ce4 100644 (file)
@@ -103,4 +103,5 @@ void addfile __ARGS((garray_T *gap, char_u *f, int flags));
 char_u *get_cmd_output __ARGS((char_u *cmd, char_u *infile, int flags, int *ret_len));
 void FreeWild __ARGS((int count, char_u **files));
 int goto_im __ARGS((void));
+char_u *get_isolated_shell_name __ARGS((void));
 /* vim: set ft=c : */
index 95daaed4b10c4486b38e2eefc04560bb11d759aa..4be0e387118b1db4cdeafc379e4dc65caae4335f 100644 (file)
@@ -734,6 +734,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    276,
 /**/
     275,
 /**/