summaryrefslogtreecommitdiffstats
path: root/src/ex_cmds.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2014-05-07 15:10:21 +0200
committerBram Moolenaar <Bram@vim.org>2014-05-07 15:10:21 +0200
commit75a8d74cc22d66482a1149f004b04bcc0a8326f2 (patch)
tree629f2de2aa52c4640127d42768299b1166ab59a3 /src/ex_cmds.c
parentf4d7f167f3c1e26f26c4b5905db553eb94aa9e81 (diff)
updated for version 7.4.276v7.4.276
Problem: The fish shell is not supported. Solution: Use begin/end instead of () for fish. (Andy Russell)
Diffstat (limited to 'src/ex_cmds.c')
-rw-r--r--src/ex_cmds.c25
1 files changed, 19 insertions, 6 deletions
diff --git a/src/ex_cmds.c b/src/ex_cmds.c
index 48700f0034..39f6791b64 100644
--- a/src/ex_cmds.c
+++ b/src/ex_cmds.c
@@ -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] == '+')))