aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--editors/vi.c17
1 files changed, 3 insertions, 14 deletions
diff --git a/editors/vi.c b/editors/vi.c
index e6c87560d..6689e290b 100644
--- a/editors/vi.c
+++ b/editors/vi.c
@@ -1615,16 +1615,6 @@ static Byte *char_insert(Byte * p, Byte c) // insert the char c at 'p'
1615 if ((p[-1] != '\n') && (dot>text)) { 1615 if ((p[-1] != '\n') && (dot>text)) {
1616 p--; 1616 p--;
1617 p = text_hole_delete(p, p); // shrink buffer 1 char 1617 p = text_hole_delete(p, p); // shrink buffer 1 char
1618#ifdef CONFIG_FEATURE_VI_DOT_CMD
1619 // also rmove char from last_modifying_cmd
1620 if (last_modifying_cmd != 0 && strlen((char *) last_modifying_cmd) > 0) {
1621 Byte *q;
1622
1623 q = last_modifying_cmd;
1624 q[strlen((char *) q) - 1] = '\0'; // erase BS
1625 q[strlen((char *) q) - 1] = '\0'; // erase prev char
1626 }
1627#endif /* CONFIG_FEATURE_VI_DOT_CMD */
1628 } 1618 }
1629 } else { 1619 } else {
1630 // insert a char into text[] 1620 // insert a char into text[]
@@ -2009,11 +1999,10 @@ static void start_new_cmd_q(Byte c)
2009 memset(last_modifying_cmd, '\0', BUFSIZ); // clear new cmd queue 1999 memset(last_modifying_cmd, '\0', BUFSIZ); // clear new cmd queue
2010 // if there is a current cmd count put it in the buffer first 2000 // if there is a current cmd count put it in the buffer first
2011 if (cmdcnt > 0) 2001 if (cmdcnt > 0)
2012 sprintf((char *) last_modifying_cmd, "%d", cmdcnt); 2002 sprintf((char *) last_modifying_cmd, "%d%c", cmdcnt, c);
2013 // save char c onto queue 2003 else // just save char c onto queue
2014 last_modifying_cmd[strlen((char *) last_modifying_cmd)] = c; 2004 last_modifying_cmd[0] = c;
2015 adding2q = 1; 2005 adding2q = 1;
2016 return;
2017} 2006}
2018 2007
2019static void end_cmd_q(void) 2008static void end_cmd_q(void)