aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRon Yorston <rmy@pobox.com>2021-04-25 11:53:54 +0100
committerDenys Vlasenko <vda.linux@googlemail.com>2021-04-28 11:29:33 +0200
commite6bc8a29a9f5e679f5c2f8e1ab3541dc99752350 (patch)
tree11b9c15fa75ed55b4810f82b93fe228fe77a6c59
parentb9aaa375a3acd83eeca8721d925bca67398bd3af (diff)
downloadbusybox-w32-e6bc8a29a9f5e679f5c2f8e1ab3541dc99752350.tar.gz
busybox-w32-e6bc8a29a9f5e679f5c2f8e1ab3541dc99752350.tar.bz2
busybox-w32-e6bc8a29a9f5e679f5c2f8e1ab3541dc99752350.zip
vi: preserve state when switching file
When a new file is opened from an existing editing session the following details should be preserved: - the last command used; - the last character searched for on a line. function old new delta edit_file 849 835 -14 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 0/1 up/down: 0/-14) Total: -14 bytes Signed-off-by: Ron Yorston <rmy@pobox.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
-rw-r--r--editors/vi.c2
1 files changed, 0 insertions, 2 deletions
diff --git a/editors/vi.c b/editors/vi.c
index 7de55d1e6..8d9d04a88 100644
--- a/editors/vi.c
+++ b/editors/vi.c
@@ -4462,7 +4462,6 @@ static void edit_file(char *fn)
4462 mark[26] = mark[27] = text; // init "previous context" 4462 mark[26] = mark[27] = text; // init "previous context"
4463#endif 4463#endif
4464 4464
4465 last_search_char = '\0';
4466#if ENABLE_FEATURE_VI_CRASHME 4465#if ENABLE_FEATURE_VI_CRASHME
4467 last_input_char = '\0'; 4466 last_input_char = '\0';
4468#endif 4467#endif
@@ -4489,7 +4488,6 @@ static void edit_file(char *fn)
4489#if ENABLE_FEATURE_VI_DOT_CMD 4488#if ENABLE_FEATURE_VI_DOT_CMD
4490 free(ioq_start); 4489 free(ioq_start);
4491 ioq_start = NULL; 4490 ioq_start = NULL;
4492 lmc_len = 0;
4493 adding2q = 0; 4491 adding2q = 0;
4494#endif 4492#endif
4495 4493