tex: handle variants of substitute command in ex_arg() - neatvi - [fork] simple vi-type editor with UTF-8 support
(HTM) git clone git://src.adamsgaard.dk/neatvi
(DIR) Log
(DIR) Files
(DIR) Refs
(DIR) README
---
(DIR) commit 16eb081e786b544797606b0d0e8d4393c32b13ff
(DIR) parent 1a5dcfa46dc0770bfe79f8f3ef2e5990b1fe98b9
(HTM) Author: Ali Gholami Rudi <ali@rudi.ir>
Date: Fri, 26 Nov 2021 21:19:14 +0330
ex: handle variants of substitute command in ex_arg()
Diffstat:
M ex.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
---
(DIR) diff --git a/ex.c b/ex.c
t@@ -912,6 +912,7 @@ static char *ex_cmd(char *src, char *cmd)
static char *ex_arg(char *src, char *dst, char *excmd)
{
int c0 = excmd[0];
+ int c1 = excmd[1];
while (*src == ' ' || *src == '\t')
src++;
if (c0 == '!' || c0 == 'g' || c0 == 'v' ||
t@@ -921,7 +922,7 @@ static char *ex_arg(char *src, char *dst, char *excmd)
*dst++ = *src++;
*dst++ = *src++;
}
- } else if (c0 == 's') {
+ } else if ((c0 == 's' && c1 != 'e') || c0 == '&' || c0 == '~') {
int delim = *src;
int cnt = 2;
*dst++ = *src++;