aboutsummaryrefslogtreecommitdiff
path: root/editors
diff options
context:
space:
mode:
authorRon Yorston <rmy@pobox.com>2021-04-25 11:53:23 +0100
committerDenys Vlasenko <vda.linux@googlemail.com>2021-04-28 11:29:33 +0200
commitb9aaa375a3acd83eeca8721d925bca67398bd3af (patch)
treea147d6e3ec9b57a6a278d2712d54ed82da9c2451 /editors
parent09172582daa98f575a711de2f0e3cf3bf88b8346 (diff)
downloadbusybox-w32-b9aaa375a3acd83eeca8721d925bca67398bd3af.tar.gz
busybox-w32-b9aaa375a3acd83eeca8721d925bca67398bd3af.tar.bz2
busybox-w32-b9aaa375a3acd83eeca8721d925bca67398bd3af.zip
vi: 'ZZ' should warn if there are more files to edit
When 'ZZ' was used to save the current file and more files were available to edit BusyBox vi immediately moved on to the next file. The correct behaviour is to issue a warning. function old new delta do_cmd 4673 4724 +51 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 1/0 up/down: 51/0) Total: 51 bytes Signed-off-by: Ron Yorston <rmy@pobox.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'editors')
-rw-r--r--editors/vi.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/editors/vi.c b/editors/vi.c
index a38f2189d..7de55d1e6 100644
--- a/editors/vi.c
+++ b/editors/vi.c
@@ -4010,6 +4010,14 @@ static void do_cmd(int c)
4010 } else { 4010 } else {
4011 editing = 0; 4011 editing = 0;
4012 } 4012 }
4013 // are there other files to edit?
4014 j = cmdline_filecnt - optind - 1;
4015 if (editing == 0 && j > 0) {
4016 editing = 1;
4017 modified_count = 0;
4018 last_modified_count = -1;
4019 status_line_bold("%u more file(s) to edit", j);
4020 }
4013 break; 4021 break;
4014 case '^': // ^- move to first non-blank on line 4022 case '^': // ^- move to first non-blank on line
4015 dot_begin(); 4023 dot_begin();