← Commit list

91075de0a

Denys Vlasenko
Denys Vlasenko
2026-02-07
SUCCESS Duration: 160s

Subject

vi: code shrink

Binary

No binary (build failed)

Architecture & Compiler Flags

Architecture: x86_64-linux-gnu Compiler: gcc (Ubuntu 11.4.0-1ubuntu1~22.04.3) 11.4.0
gcc -Wp,-MD,applets/.usage.d -Wall -Wstrict-prototypes -O2 -fomit-frame-pointer      -Iinclude -Iinclude -o applets/usage applets/usage.c

Build Log

(log yok)

Commit Diff GitHub →

editors/vi.c+9 -7
@@ -1096,11 +1096,15 @@ static void redraw(int full_screen)
//----- Flash the screen --------------------------------------
static void flash(int h)
{
- standout_start();
- redraw(TRUE);
+ //standout_start();
+ //redraw(TRUE);
+ write1(ESC"[?5h"); // "reverse screen on"
+
mysleep(h);
- standout_end();
- redraw(TRUE);
+
+ //standout_end();
+ //redraw(TRUE);
+ write1(ESC"[?5l"); // "reverse screen off"
}
static void indicate_error(void)
@@ -2787,7 +2791,6 @@ static char *regex_search(char *q, regex_t *preg, const char *Rorig,
# define strchr_backslash(s, c) strchr(s, c)
#endif /* ENABLE_FEATURE_VI_REGEX_SEARCH */
-// buf must be no longer than MAX_INPUT_LEN!
static void colon(char *buf)
{
#if !ENABLE_FEATURE_VI_COLON
@@ -4789,8 +4792,7 @@ static void run_cmds(char *p)
if (p)
while (*p == '\n')
*p++ = '\0';
- if (strlen(q) < MAX_INPUT_LEN)
- colon(q);
+ colon(q);
}
}
#endif