tvi: repeating . and @ commands - 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 df9f5a424f9e869ce1367f3c9ee3ceee84683f9f
(DIR) parent 3846d47a04c5febd2c81aa1668832f56960f1617
(HTM) Author: Ali Gholami Rudi <ali@rudi.ir>
Date: Sat, 7 May 2016 20:51:15 +0430
vi: repeating . and @ commands
Diffstat:
M vi.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
---
(DIR) diff --git a/vi.c b/vi.c
t@@ -1021,7 +1021,9 @@ static int rep_len;
static void vc_repeat(void)
{
- term_push(rep_cmd, rep_len);
+ int i;
+ for (i = 0; i < MAX(1, vi_arg1); i++)
+ term_push(rep_cmd, rep_len);
}
static void vc_execute(void)
t@@ -1030,6 +1032,7 @@ static void vc_execute(void)
int lnmode;
int c = vi_read();
char *buf;
+ int i;
if (TK_INT(c))
return;
if (c == '@')
t@@ -1037,7 +1040,8 @@ static void vc_execute(void)
exec_buf = c;
buf = reg_get(exec_buf, &lnmode);
if (buf)
- term_push(buf, strlen(buf));
+ for (i = 0; i < MAX(1, vi_arg1); i++)
+ term_push(buf, strlen(buf));
}
static void vi(void)