aboutsummaryrefslogtreecommitdiff
path: root/editors/vi.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
* winansi: add a routine to clear the screen bufferansiRon Yorston2016-04-261-0/+5
| | | | | And use it to restore the old behaviour of vi and less: they reset the cursor to the top of the buffer and clear it.
* 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%"
* | Merge branch 'busybox' into mergeRon Yorston2014-10-061-43/+36
|\|
| * vi: fix incorrect memory access on brace matching. Closes 7256Denys Vlasenko2014-09-151-43/+36
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | While at it, fix brace matching to actually show the match (missed fflush was causing cursor positioning to be buffered); shorten brace matching code; remove unused macro indirection in indicate_error(). Custom linker script 'busybox_ldscript' found, using it function old new delta indicate_error - 61 +61 mysleep 43 56 +13 char_insert 483 486 +3 find_pair 167 124 -43 Indicate_Error 61 - -61 ------------------------------------------------------------------------------ (add/remove: 1/1 grow/shrink: 2/1 up/down: 77/-104) Total: -27 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* | Merge branch 'busybox' into mergeRon Yorston2014-05-061-189/+606
|\| | | | | | | | | | | | | Conflicts: debianutils/which.c editors/vi.c libbb/executable.c
| * vi: some simplificationsDenys Vlasenko2014-04-051-116/+120
| | | | | | | | | | | | | | | | | | | | | | | | function old new delta file_insert 301 315 +14 init_text_buffer 179 171 -8 colon 2889 2878 -11 file_size 37 - -37 ------------------------------------------------------------------------------ (add/remove: 0/1 grow/shrink: 1/2 up/down: 14/-56) Total: -42 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * vi: clear undo buffer when we change to another fileDenys Vlasenko2014-04-031-69/+87
| | | | | | | | | | | | | | | | | | | | | | | | function old new delta init_text_buffer 156 190 +34 undo_push 360 382 +22 count_lines 74 72 -2 undo_pop 246 222 -24 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 2/2 up/down: 56/-26) Total: 30 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * vi: undo code shrinkDenys Vlasenko2014-04-031-41/+42
| | | | | | | | | | | | | | | | function old new delta undo_push 414 395 -19 do_cmd 4803 4761 -42 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * vi: undo support for vi with intermediate queuingJody Bruchon2014-04-021-54/+448
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | function old new delta undo_push - 411 +411 undo_pop - 288 +288 do_cmd 4160 4426 +266 char_insert 363 483 +120 undo_queue_commit - 61 +61 text_hole_delete 108 163 +55 string_insert 94 127 +33 colon 2864 2882 +18 yank_delete 92 101 +9 vi_main 273 280 +7 dot_scroll 88 93 +5 dot_right 29 34 +5 dot_prev 20 25 +5 dot_next 20 25 +5 dot_left 24 29 +5 dot_end 20 25 +5 dot_begin 20 25 +5 init_text_buffer 154 156 +2 text_hole_make 145 142 -3 file_insert 333 318 -15 ------------------------------------------------------------------------------ (add/remove: 3/0 grow/shrink: 15/2 up/down: 1305/-18) Total: 1287 bytes (without queuing it's ~870 bytes) Signed-off-by: Jody Bruchon <jody@jodybruchon.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* | Merge branch 'busybox' into mergeRon Yorston2013-08-271-40/+28
|\|
| * vi: make regexp search case-insensitive if ":set ignorecase" is activeDenys Vlasenko2013-04-211-40/+28
| | | | | | | | | | | | Reported by Dan Moinescu <dan@moinescu.net>. Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* | vi: handle CRLF line endingRon Yorston2013-03-191-0/+38
| |
* | Merge branch 'busybox' into mergeRon Yorston2013-03-191-5/+11
|\|
| * vi: code shrinkDenys Vlasenko2013-03-151-4/+10
| | | | | | | | | | | | | | | | | | | | | | function old new delta status_line_bold_errno - 32 +32 colon 2891 2873 -18 file_insert 354 313 -41 ------------------------------------------------------------------------------ (add/remove: 1/0 grow/shrink: 0/2 up/down: 32/-59) Total: -27 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * vi: fix adjustment of buffer on partial file readRon Yorston2013-03-151-1/+1
| | | | | | | | | | | | | | | | The second argument to text_hole_delete was incorrect: it should be a pointer to the end of the hole. Signed-off-by: Ron Yorston <rmy@tigress.co.uk> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* | Merge branch 'busybox' into mergeRon Yorston2013-02-071-20/+20
|\|
| * *: reuse more stringsDenys Vlasenko2013-01-221-14/+14
| | | | | | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * whitespace fixes. no code changesDenys Vlasenko2013-01-151-5/+5
| | | | | | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * whitespace cleanup. no code changesDenys Vlasenko2013-01-141-1/+1
| | | | | | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* | Merge branch 'busybox' into mergeRon Yorston2012-09-071-131/+70
|\| | | | | | | | | | | Conflicts: include/libbb.h shell/ash.c
| * vi: save/restore screen upon invocationDenys Vlasenko2012-06-111-0/+4
| | | | | | | | | | | | | | function old new delta vi_main 253 273 +20 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * vi: nuke FEATURE_VI_OPTIMIZE_CURSORDenys Vlasenko2012-06-111-124/+58
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It is not Unicode safe, it is not saving much of I/O, and it's large: function old new delta vi_main 255 253 -2 go_bottom_and_clear_to_eol 28 26 -2 do_cmd 4194 4182 -12 show_status_line 388 374 -14 strncat 39 - -39 __GI_strncat 39 - -39 refresh 774 724 -50 place_cursor 276 83 -193 ------------------------------------------------------------------------------ (add/remove: 0/3 grow/shrink: 0/6 up/down: 0/-351) Total: -351 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * vi: do not set autoindent by defaultDenys Vlasenko2012-06-111-7/+8
| | | | | | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* | Merge branch 'busybox' into mergeRon Yorston2012-03-231-40/+57
|\| | | | | | | | | Conflicts: Makefile.flags
| * vi: add ":prev" command supportDennis Groenen2012-01-311-11/+18
| | | | | | | | | | | | | | | | | | | | | | function old new delta colon 2844 2891 +47 vi_main 243 255 +12 text_yank 54 56 +2 refresh 780 774 -6 Signed-off-by: Dennis Groenen <tj.groenen@gmail.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * vi: move mark[i] pointers if text[] moves after reallocDenys Vlasenko2012-01-311-27/+37
| | | | | | | | | | | | | | | | | | | | While at it, optimized :s/find/repl/ a bit function old new delta text_hole_make 120 150 +30 colon 2848 2844 -4 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * *: better comments on termios manipulations. No code changes.Denys Vlasenko2012-01-151-1/+1
| | | | | | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * vi: fix [end] key handlingDenys Vlasenko2011-11-281-1/+1
| | | | | | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* | Merge commit 'c0cae52662ccced9df19f19ec94238d1b1e3bd71' into mergeRon Yorston2012-03-231-155/+139
|\| | | | | | | | | | | Conflicts: Makefile.flags scripts/basic/fixdep.c
| * vi: prevent unlimited recursion in do_cmd(). Closes 4153Denys Vlasenko2011-09-091-155/+139
| | | | | | | | | | | | | | function old new delta do_cmd 4284 4194 -90 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* | Merge commit 'd84b175cb6948eb17f847313bf912174e2f934e1' into mergeRon Yorston2012-03-221-2/+2
|\| | | | | | | | | Conflicts: include/platform.h
| * less: optionally query terminal size via "ESC [ 6 n". Closes bug 2659.Denys Vlasenko2011-07-251-2/+2
| | | | | | | | | | | | +7 bytes is not selected, +100 if selected. Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* | Merge commit '066f39956641300c1e5c6bfe6c11a115cea3e2cf' into mergeRon Yorston2012-03-221-43/+186
|\| | | | | | | | | Conflicts: procps/ps.c
| * vi: tweak regex.h includeDenys Vlasenko2011-07-031-3/+6
| | | | | | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * vi: fix regex search, make it selectable in configWalter Harms2011-06-271-40/+181
| | | | | | | | | | | | | | | | | | | | function old new delta char_search 134 214 +80 find_pair 187 169 -18 mycmp 37 - -37 Signed-off-by: Walter Harms <wharms@bfs.de> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * *: remove "Options:" string from help textsDenys Vlasenko2011-06-051-1/+0
| | | | | | | | | | | | | | function old new delta packed_usage 28706 28623 -83 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* | Merge commit '56a3b82e9692a25ef9c9269e88feac0d579ce8e8' into mergeRon Yorston2012-03-221-2/+4
|\| | | | | | | | | | | | | Conflicts: coreutils/ls.c include/platform.h libbb/bb_basename.c
| * vi.c: remove warning: variable 'sp' set but not usedCristian Ionescu-Idbohrn2011-05-161-0/+4
| | | | | | | | | | Signed-off-by: Cristian Ionescu-Idbohrn <cii@axis.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>