aboutsummaryrefslogtreecommitdiff
path: root/editors/vi.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
...
* | vi: display pasted textRon Yorston2019-01-261-1/+14
| | | | | | | | | | | | | | | | | | | | vi tries to avoid updating the display if more input is available. This didn't work when text was pasted in because a key release event was left in the event queue. When mysleep() is called to test for this condition allow up to one event to be present in the queue before reporting that input is available.
* | Merge branch 'busybox' into mergeRon Yorston2019-01-101-1/+1
|\|
| * config: update size informationDenys Vlasenko2018-12-281-1/+1
| | | | | | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* | Merge branch 'busybox' into mergeRon Yorston2018-12-051-18/+27
|\|
| * vi: correctly detect when a deletion empties the bufferRon Yorston2018-12-031-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Michał Berger has reported two issues: - Repeatedly deleting and undoing the deletion of the last line results in characters being lost from the end of the line. - Deleting the bottom line twice then attempting to undo each of these deletions results in a segfault. The problem seems to be an incorrect test for whether the text buffer is empty. Reported-by: Michał Berger <michallinuxstuff@gmail.com> Signed-off-by: Ron Yorston <rmy@pobox.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * vi: code shrinkDenys Vlasenko2018-11-291-13/+17
| | | | | | | | | | | | | | | | | | | | | | | | function old new delta char_search 241 247 +6 get_one_address 275 272 -3 colon 2878 2875 -3 do_cmd 4726 4720 -6 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 1/3 up/down: 6/-12) Total: -6 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * vi: fix FEATURE_VI_REGEX_SEARCH to respect LIMITED (one-line) searchDenys Vlasenko2018-11-291-5/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If busybox is compiled with FEATURE_VI_REGEX_SEARCH enabled, command ":s/x/y/" searches not only in the current line, but continues search after it. This makes range searches (":1,3s/x/y/") work incorrect. For example file "./test": 1 2 3 $ vi ./test :1,2s/3/e/ gives us: 1 2 e function old new delta char_search 213 241 +28 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * vi: remove duplicated codeRon Yorston2018-10-311-6/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | At worst show_status_line() might be called needlessly when the user presses ^L/^R, but I don't think we'll get many complaints about that. function old new delta do_cmd 4592 4558 -34 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 0/1 up/down: 0/-34) Total: -34 bytes Signed-off-by: Ron Yorston <rmy@pobox.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* | vi: save a few bytesRon Yorston2018-11-261-14/+8
| |
* | Merge branch 'busybox'Ron Yorston2018-07-251-26/+35
|\|
| * vi: placate "warning: variable orig_buf set but not used"Denys Vlasenko2018-06-271-25/+31
| | | | | | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * vi: placate "warning: statement with no effect"Denys Vlasenko2018-06-271-1/+4
| | | | | | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* | win32: exclude termios codeRon Yorston2018-04-051-0/+6
| | | | | | | | | | The code to manipulate terminal settings serves no purpose in WIN32. Use conditional compilation to exclude much of it.
* | Merge branch 'busybox' into mergeRon Yorston2017-11-031-3/+3
|\|
| * use %m printf specifier where appropriateDenys Vlasenko2017-09-291-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | function old new delta out 85 75 -10 udhcpd_main 1472 1461 -11 open_stdio_to_tty 98 85 -13 init_exec 245 232 -13 udhcpc_main 2763 2749 -14 do_cmd 4771 4755 -16 status_line_bold_errno 32 14 -18 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 0/7 up/down: 0/-95) Total: -95 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* | Merge branch 'busybox' into mergeRon Yorston2017-09-271-12/+11
|\|
| * regularize format of source file headers, no code changesDenys Vlasenko2017-09-181-2/+0
| | | | | | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * *: use ESC define instead of "\033"; use ESC[m instead of ESC[0mDenys Vlasenko2017-09-131-10/+11
| | | | | | | | | | | | | | | | text data bss dec hex filename 922535 481 6832 929848 e3038 busybox_old 922534 481 6832 929847 e3037 busybox_unstripped Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* | Merge branch 'busybox' into mergeRon Yorston2017-07-241-42/+42
|\|
| * config: deindent all help textsDenys Vlasenko2017-07-211-41/+41
| | | | | | | | | | | | Those two spaces after tab have no effect, and always a nuisance when editing. Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * libarchive: FEATURE_LZMA_FAST should be visible if FEATURE_SEAMLESS_LZMADenys Vlasenko2017-07-201-1/+1
| | | | | | | | | | | | While at it, tweak some config help texts. Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * Update menuconfig items with approximate applet sizesDenys Vlasenko2017-07-181-1/+1
| | | | | | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* | Merge branch 'busybox' into mergeRon Yorston2017-05-291-26/+42
|\|
| * vi: survive if stdin is nonblocking. closes 9851Denys Vlasenko2017-05-021-1/+8
| | | | | | | | | | | | | | function old new delta readit 55 69 +14 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * vi: avoid touching a new file with ZZ when no editing has been doneYousong Zhou2017-03-241-8/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This is the behaviour observed with standard vim and busybox vi of at least 1.22.1. It was changed with commit "32afd3a vi: some simplifications" which happened before 1.23.0. Mistyping filename on command line happens fairly often and it's better we restore the old behaviour to avoid a few unnecessary flash writes and sometimes efforts of debugging bugs caused by those unneeded stray files. Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * vi: don't touch file with :x when modified_count == 0Denys Vlasenko2017-03-131-17/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Along with it, there are other changes - Check for uppercase X is removed as the expression will be always false and :X itself is another totally different command in standard vim - The status line will show number of written lines instead of lines requested by the colon command. This is also how the standard vim is doing, though the difference is that '!' has to be explicitly specified in vim to allow partial writes Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* | Merge branch 'busybox' into mergeRon Yorston2017-02-081-30/+20
|\|
| * vi,fsck: do not use build timestamp unconditionally. Closes 9626Denys Vlasenko2017-01-291-1/+1
| | | | | | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * libbb: consolidate the code to set termios unbuffered modeDenys Vlasenko2017-01-111-11/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | function old new delta set_termios_to_raw - 116 +116 count_lines 72 74 +2 powertop_main 1458 1430 -28 top_main 943 914 -29 more_main 759 714 -45 fsck_minix_main 2969 2921 -48 conspy_main 1197 1135 -62 rawmode 99 36 -63 ------------------------------------------------------------------------------ (add/remove: 1/0 grow/shrink: 1/6 up/down: 118/-275) Total: -157 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * Big cleanup in config help and descriptionDenys Vlasenko2017-01-101-18/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | Redundant help texts (one which only repeats the description) are deleted. Descriptions and help texts are trimmed. Some config options are moved, even across menus. No config option _names_ are changed. Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* | Merge branch busybox (up to "ash: comment out free(p) just before...")Ron Yorston2016-10-191-6/+8
|\|
| * vi: fix '' command (goto to prev context)Denys Vlasenko2016-09-281-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | The '' command in vi doesn't currently work because after the first apostrophe is read, the next character is converted to an integer between 0 and 25 inclusive (for indexing the array of marks). The comparison of the converted character with an apostrophe therefore never succeeds, meaning that '' doesn't do anything. Based on the patch by Francis Rounds <francis.rounds@4bridgeworks.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * vi: make "g<key>" error message less likely to show garbageDenys Vlasenko2016-09-151-1/+3
| | | | | | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* | vi: remove duplicated codeRon Yorston2016-07-081-6/+1
| | | | | | | | | | | | At worst show_status_line() might be called needlessly when the user presses ^L/^R, but I don't think we'll get many complaints about that.
* | Merge branch 'busybox' into mergeRon Yorston2016-05-161-1/+1
|\|
| * *: slap on a few ALIGN1/2s where appropriateDenys Vlasenko2016-04-221-1/+1
| | | | | | | | | | | | | | | | | | | | The result of looking at "grep -F -B2 '*fill*' busybox_unstripped.map" text data bss dec hex filename 829901 4086 1904 835891 cc133 busybox_before 829665 4086 1904 835655 cc047 busybox Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* | winansi: revert to previous console behaviour for vi/lessRon Yorston2016-04-261-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | Recent changes to make the Windows console behave more like a *nix terminal didn't work too well for vi/less. On *nix the terminal buffer can't be scrolled while such screen-based applications are running. In the Windows console this remained possible and led to confusion. Add a new routine to allow vi/less to revert to their previous behaviour where the cursor is positioned at the top of the buffer and the entire buffer is cleared.
* | Merge branch 'busybox' into mergeRon Yorston2015-10-131-4/+4
|\|
| * join some common strings, -400 bytesDenys Vlasenko2015-10-081-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | function old new delta print_intel_cstates 499 511 +12 file_insert 355 364 +9 dpkg_main 2944 2940 -4 ifenslave_main 645 640 -5 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 2/2 up/down: 21/-9) Total: 12 bytes text data bss dec hex filename 937564 932 17676 956172 e970c busybox_old 937164 932 17676 955772 e957c busybox_unstripped Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* | Merge branch 'busybox' into mergeRon Yorston2015-07-141-8/+7
|\|
| * Removes stray empty line from codeManinder Singh2015-07-131-1/+0
| | | | | | | | | | | | | | | | | | This patch removes stray empty line from busybox code reported by script find_stray_empty_lines Signed-off-by: Maninder Singh <maninder1.s@samsung.com> Signed-off-by: Akhilesh Kumar <akhilesh.k@samsung.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * typo fixesManinder Singh2015-05-251-7/+7
| | | | | | | | | | Signed-off-by: Maninder Singh <maninder1.s@samsung.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* | Merge branch 'busybox' into mergeFRPRon Yorston2015-05-181-5/+5
|\|
| * vi: basic undo feature shouldn't depend on yankmarkAndrew Fuller2015-05-031-5/+5
| | | | | | | | | | | | | | | | | | Currently basic undo functionality with the 'u' key depends on FEATURE_VI_YANKMARK. These two features are separate, so we can remove this dependency. Signed-off-by: Andrew Fuller <abf@google.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* | Merge branch 'busybox' into mergeRon Yorston2015-03-141-4/+4
|\| | | | | | | | | | | Conflicts: coreutils/od_bloaty.c libbb/lineedit.c
| * vi: make BACKSPACE and DELETE join lines at start/end of lineDenys Vlasenko2015-03-121-4/+4
| | | | | | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * vi: fix reading of file after last lineRon Yorston2015-01-071-1/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If the :r command is used to read a file after the last line of the buffer the last line of the buffer and the first line of the file are joined. An extra blank line appears at the end of the buffer. file 1 file 1 file 1file 2 file 2 file 2 ~ ~ The insertion point is normally at the start of the line following the specified line. When the specified line is the last one the next_line function baulks at moving to the non-existent following line. Signed-off-by: Ron Yorston <rmy@tigress.co.uk> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * vi: failure to open file is not an error when initialising bufferRon Yorston2015-01-071-7/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | Commit 32afd3a introduced these regressions on the master branch: Starting vi with no filename on the command line gives the status message "'(null)' Bad address" instead of "- No file 1/1 100%". Starting vi with a non-existent file on the command line gives the status message "'new.txt' No such file or directory" instead of "- new.txt 1/1 100%" Signed-off-by: Ron Yorston <rmy@tigress.co.uk> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* | vi: fix reading of file after last lineRon Yorston2014-12-051-1/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If the :r command is used to read a file after the last line of the buffer the last line of the buffer and the first line of the file are joined. An extra blank line appears at the end of the buffer. file 1 file 1 file 1file 2 file 2 file 2 ~ ~ The insertion point is normally at the start of the line following the specified line. When the specified line is the last one the next_line function baulks at moving to the non-existent following line.
* | vi: failure to open file is not an error when initialising bufferRon Yorston2014-12-051-7/+5
| | | | | | | | | | | | | | | | | | | | Commit 32afd3a introduced these regressions on the master branch: Starting vi with no filename on the command line gives the status message "'(null)' Bad address" instead of "- No file 1/1 100%". Starting vi with a non-existent file on the command line gives the status message "'new.txt' No such file or directory" instead of "- new.txt 1/1 100%"