summaryrefslogtreecommitdiff
path: root/src/ex_cmds.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/ex_cmds.c')
-rw-r--r--src/ex_cmds.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/ex_cmds.c b/src/ex_cmds.c
index 20bba1c8..a8083b32 100644
--- a/src/ex_cmds.c
+++ b/src/ex_cmds.c
@@ -327,7 +327,14 @@ ex_sort(eap)
sort_ic = TRUE;
else if (*p == 'u')
unique = TRUE;
- else if (!ASCII_ISALPHA(*p))
+ else if (*p == '"') /* comment start */
+ break;
+ else if (check_nextcmd(p) != NULL)
+ {
+ eap->nextcmd = check_nextcmd(p);
+ break;
+ }
+ else if (!ASCII_ISALPHA(*p) && regmatch.regprog == NULL)
{
s = skip_regexp(p + 1, *p, TRUE, NULL);
if (*s != *p)
@@ -339,7 +346,7 @@ ex_sort(eap)
regmatch.regprog = vim_regcomp(p + 1, RE_MAGIC);
if (regmatch.regprog == NULL)
goto theend;
- p = s + 1;
+ p = s; /* continue after the regexp */
regmatch.rm_ic = p_ic;
}
else