diff options
| author | Denys Vlasenko <vda.linux@googlemail.com> | 2026-02-07 12:53:27 +0100 |
|---|---|---|
| committer | Denys Vlasenko <vda.linux@googlemail.com> | 2026-02-07 12:53:27 +0100 |
| commit | 91075de0a7bd987fa376dbbd624f52a11c6078e3 (patch) | |
| tree | f36e83a8261a9bce858e71e3854bdf62560c1104 | |
| parent | 1380df7a5a877787dcbe100f52dc7d1f978e7f0b (diff) | |
| download | busybox-w32-91075de0a7bd987fa376dbbd624f52a11c6078e3.tar.gz busybox-w32-91075de0a7bd987fa376dbbd624f52a11c6078e3.tar.bz2 busybox-w32-91075de0a7bd987fa376dbbd624f52a11c6078e3.zip | |
vi: code shrink
function old new delta
.rodata 107007 107019 +12
run_cmds 62 50 -12
indicate_error 78 55 -23
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 1/2 up/down: 12/-35) Total: -23 bytes
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| -rw-r--r-- | editors/vi.c | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/editors/vi.c b/editors/vi.c index 757e8eaa0..ba607bcfd 100644 --- a/editors/vi.c +++ b/editors/vi.c | |||
| @@ -1096,11 +1096,15 @@ static void redraw(int full_screen) | |||
| 1096 | //----- Flash the screen -------------------------------------- | 1096 | //----- Flash the screen -------------------------------------- |
| 1097 | static void flash(int h) | 1097 | static void flash(int h) |
| 1098 | { | 1098 | { |
| 1099 | standout_start(); | 1099 | //standout_start(); |
| 1100 | redraw(TRUE); | 1100 | //redraw(TRUE); |
| 1101 | write1(ESC"[?5h"); // "reverse screen on" | ||
| 1102 | |||
| 1101 | mysleep(h); | 1103 | mysleep(h); |
| 1102 | standout_end(); | 1104 | |
| 1103 | redraw(TRUE); | 1105 | //standout_end(); |
| 1106 | //redraw(TRUE); | ||
| 1107 | write1(ESC"[?5l"); // "reverse screen off" | ||
| 1104 | } | 1108 | } |
| 1105 | 1109 | ||
| 1106 | static void indicate_error(void) | 1110 | static void indicate_error(void) |
| @@ -2787,7 +2791,6 @@ static char *regex_search(char *q, regex_t *preg, const char *Rorig, | |||
| 2787 | # define strchr_backslash(s, c) strchr(s, c) | 2791 | # define strchr_backslash(s, c) strchr(s, c) |
| 2788 | #endif /* ENABLE_FEATURE_VI_REGEX_SEARCH */ | 2792 | #endif /* ENABLE_FEATURE_VI_REGEX_SEARCH */ |
| 2789 | 2793 | ||
| 2790 | // buf must be no longer than MAX_INPUT_LEN! | ||
| 2791 | static void colon(char *buf) | 2794 | static void colon(char *buf) |
| 2792 | { | 2795 | { |
| 2793 | #if !ENABLE_FEATURE_VI_COLON | 2796 | #if !ENABLE_FEATURE_VI_COLON |
| @@ -4789,8 +4792,7 @@ static void run_cmds(char *p) | |||
| 4789 | if (p) | 4792 | if (p) |
| 4790 | while (*p == '\n') | 4793 | while (*p == '\n') |
| 4791 | *p++ = '\0'; | 4794 | *p++ = '\0'; |
| 4792 | if (strlen(q) < MAX_INPUT_LEN) | 4795 | colon(q); |
| 4793 | colon(q); | ||
| 4794 | } | 4796 | } |
| 4795 | } | 4797 | } |
| 4796 | #endif | 4798 | #endif |
