aboutsummaryrefslogtreecommitdiff
path: root/editors/vi.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
...
| * fix "variable 'foo' set but not used" warningsDenys Vlasenko2011-05-131-2/+0
| | | | | | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* | Merge commit 'b83c9704128dd106071184e4b00335a3b8486857' into mergeRon Yorston2012-03-221-0/+13
|\|
| * move help text from include/usage.src.h to debianutils/*.c e2fsprogs/*.c ↵Pere Orga2011-04-031-0/+13
| | | | | | | | | | | | | | editors/*.c loginutils/*.c mailutils/*.c Signed-off-by: Pere Orga <gotrunks@gmail.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* | win32: vi: reimplement mysleep() because poll() won't work on stdinNguyễn Thái Ngọc Duy2010-09-141-0/+9
|/ | | | | This makes vi work on rxvt for Windows. There is work to do in winansi.c in order to make vim work on Windows console.
* *: make GNU licensing statement forms more regularDenys Vlasenko2010-08-161-1/+1
| | | | | | | This change retains "or later" state! No licensing _changes_ here, only form is adjusted (article, space between "GPL" and "v2" and so on). Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* vi: fix "ask terminal" codeDenys Vlasenko2010-07-211-10/+10
| | | | | | | | | function old new delta edit_file 761 793 +32 refresh 773 780 +7 query_screen_dimensions 63 54 -9 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* remove some dead assignments, add a TODO commentDenys Vlasenko2010-07-041-1/+0
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* vi: fix "set ic" command; code shrink while at it. closes bug 1765Denys Vlasenko2010-05-191-49/+37
| | | | | | | function old new delta colon 2970 2848 -122 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* consolidate ESC sequencesDenys Vlasenko2010-05-161-8/+8
| | | | | | | | | | | | | | function old new delta bell 2 - -2 CMdown 2 - -2 Ceos 4 - -4 Ceol 4 - -4 CMup 4 - -4 SOs 5 - -5 SOn 5 - -5 CMrc 9 - -9 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* lineedit: change how cmdedit_set_out_char worksDenys Vlasenko2010-05-111-2/+2
| | | | | | | | | | | | | | | | | | | Rename two badly names functions, use "clear to end of screen" to eliminate annoying problems with clearing wide/combining chars, and such. Run tested. function old new delta put_cur_glyph_and_inc_cursor - 124 +124 put_till_end_and_adv_cursor - 24 +24 input_delete 125 130 +5 Ceos 5 4 -1 Ceol 5 4 -1 input_end 24 - -24 cmdedit_set_out_char 122 - -122 ------------------------------------------------------------------------------ (add/remove: 2/2 grow/shrink: 1/2 up/down: 153/-148) Total: 5 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* vi: discover window size even on serial consoles. optionalDenys Vlasenko2010-04-181-1/+22
| | | | | | | | | | | | | | | | function old new delta edit_file 671 761 +90 wh_helper - 57 +57 query_screen_dimensions 54 63 +9 ar_main 533 542 +9 refresh 767 773 +6 vi_main 242 243 +1 text_yank 56 54 -2 get_terminal_width_height 180 135 -45 ------------------------------------------------------------------------------ (add/remove: 1/0 grow/shrink: 5/2 up/down: 172/-47) Total: 125 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* vi: remove superfluous check on filename == ""Denys Vlasenko2010-04-181-1/+1
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* vi: code shrinkDenys Vlasenko2010-04-161-9/+9
| | | | | | | | | | function old new delta vi_main 250 242 -8 colon 2980 2970 -10 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 0/2 up/down: 0/-18) Total: -18 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* vi: code shrink; save/restore errno in signal handlersDenys Vlasenko2010-04-161-19/+27
| | | | | | | | | | | | | | | function old new delta query_screen_dimensions - 54 +54 suspend_sig 50 64 +14 cont_sig 65 66 +1 catch_sig 42 32 -10 winch_sig 88 60 -28 edit_file 719 671 -48 refresh 848 767 -81 ------------------------------------------------------------------------------ (add/remove: 1/0 grow/shrink: 2/4 up/down: 69/-167) Total: -98 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* vi: fix NUM + "$" handlingDenys Vlasenko2010-03-261-38/+39
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* lineedit: fix another corner case with bad unicode inputDenys Vlasenko2010-03-111-1/+1
| | | | | | | | | | | | | | | | | function old new delta read_key 607 646 +39 readit 50 55 +5 getch_nowait 290 295 +5 hash_find 233 234 +1 xstrtoul_range_sfx 231 230 -1 passwd_main 1058 1056 -2 builtin_exit 45 43 -2 cmp_main 649 645 -4 lineedit_read_key 257 245 -12 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 4/5 up/down: 50/-21) Total: 29 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* *: style fixes. no code changes (verified with objdump)Denys Vlasenko2010-01-281-3/+5
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* fix fallout from isprint() changesDenys Vlasenko2009-11-201-24/+25
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* libbb: robustify isXXXX(). +39 bytesDenys Vlasenko2009-11-181-2/+2
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* *: use "can't" instead of "cannot"Denys Vlasenko2009-11-131-1/+1
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* *: introduce and use ffulsh_all()Denys Vlasenko2009-11-021-4/+4
| | | | | | | | | | | | | | | | | | | | function old new delta buffer_fill_and_print 179 196 +17 fflush_all - 9 +9 spawn 87 92 +5 rtcwake_main 455 453 -2 ... alarm_intr 93 84 -9 readcmd 1072 1062 -10 bb_ask 345 333 -12 more_main 845 832 -13 flush_stdout_stderr 42 23 -19 xfflush_stdout 27 - -27 flush_stderr 30 - -30 ------------------------------------------------------------------------------ (add/remove: 1/2 grow/shrink: 2/50 up/down: 31/-397) Total: -366 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* *: remove last function calls to isspaceDenys Vlasenko2009-10-221-5/+5
| | | | | | | | | | | function old new delta xstrtoul_range_sfx 232 231 -1 xstrtoull_range_sfx 295 293 -2 trim 82 80 -2 trim_trailing_spaces_and_print 57 52 -5 isspace 18 - -18 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* *: a few more NOINLINEsDenys Vlasenko2009-10-081-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | function old new delta print_linkinfo - 815 +815 do_msg - 783 +783 INET_setroute - 757 +757 varvalue - 746 +746 do_sem - 637 +637 inflate_codes - 617 +617 INET6_setroute - 491 +491 edir - 370 +370 sync_cursor - 298 +298 update_utmp - 246 +246 searchLines - 165 +165 setup_alarm - 144 +144 may_wakeup - 101 +101 getNum 566 371 -195 refresh 1166 848 -318 rtcwake_main 809 479 -330 getty_main 2396 1921 -475 chpst_main 1373 746 -627 inflate_unzip_internal 1335 567 -768 evalvar 1384 612 -772 ipaddr_list_or_flush 2160 1246 -914 route_main 1585 245 -1340 ipcs_main 2523 1049 -1474 ------------------------------------------------------------------------------ (add/remove: 13/0 grow/shrink: 0/10 up/down: 6170/-7213) Total: -1043 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* *: more portability fixes by Dan FandrichDenys Vlasenko2009-09-231-2/+2
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* fix dependencies of FEATURE_GETOPT_LONGDenys Vlasenko2009-07-041-3/+3
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* vi: do not accept uppercase comments (compat). Closes bug 397.Denys Vlasenko2009-06-151-33/+31
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* line editing: add an option to emit ESC [ 6 n and use resultsDenys Vlasenko2009-05-171-7/+6
| | | | | | | | | This makes line editing able to recognize case when cursor was not at the beginning of the line. It may also be adapted later to find out display size (serial line users would love it). Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* *: mass renaming of USE_XXXX to IF_XXXXDenis Vlasenko2009-04-211-8/+8
| | | | | | and SKIP_XXXX to IF_NOT_XXXX - the second one was especially badly named. It was not skipping anything!
* trailing whitespace removalDenis Vlasenko2009-04-011-2/+2
|
* vi: speedup and code shrink (Walter Harms)Denis Vlasenko2008-11-241-21/+17
| | | | | | networking/interface.c: silence warning (Vladimir) wget: more robust EINTR detection
* vi: fix several instances of major goof: when text grows, text[]Denis Vlasenko2008-11-191-45/+78
| | | | | | | | | | | | | | | | might get reallocated! We were keeping around pointers to old place... function old new delta colon 3017 3037 +20 char_insert 336 354 +18 stupid_insert 18 24 +6 string_insert 89 94 +5 do_cmd 4461 4465 +4 file_insert 328 329 +1 text_hole_make 134 120 -14 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 6/1 up/down: 54/-14) Total: 40 bytes
* *: code shrink by adding a wrapper around very common tcsetattr(0, TCSANOW, ↵Denis Vlasenko2008-11-051-2/+2
| | | | | | | | | | | | | | | | | | | | | | xx) op function old new delta tcsetattr_stdin_TCSANOW - 14 +14 set_sane_term 116 113 -3 top_main 1277 1273 -4 make_new_session 421 415 -6 rawmode 133 126 -7 reset_term 18 10 -8 die 43 35 -8 cookmode 62 54 -8 vlock_main 425 415 -10 read_line_input 3165 3155 -10 bb_askpass 357 347 -10 fsck_minix_main 3079 3065 -14 getty_main 2375 2332 -43 ------------------------------------------------------------------------------ (add/remove: 1/0 grow/shrink: 0/12 up/down: 14/-131) Total: -117 bytes
* randomconfig fixesDenis Vlasenko2008-10-291-1/+2
|
* vi: fix uninitialized last_search_pattern (bug 5794)Denis Vlasenko2008-10-291-10/+5
|
* less: reuse former vi's key reading code. Improve SIGWINCH handling.Denis Vlasenko2008-10-251-1/+1
| | | | | | | | | | | | | | | function old new delta less_main 2056 2097 +41 getch_nowait 248 273 +25 read_key 310 321 +11 static.esccmds 61 69 +8 count_lines 72 74 +2 less_gets 166 142 -24 less_getch 172 43 -129 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 6/5 up/down: 91/-170) Total: -79 bytes text data bss dec hex filename
* vi: move key reading routine out of vi into llbbbDenis Vlasenko2008-10-251-185/+44
| | | | | | | | | | | function old new delta read_key - 310 +310 .... static.esccmds 170 61 -109 readit 286 60 -226 ------------------------------------------------------------------------------ (add/remove: 1/0 grow/shrink: 9/10 up/down: 349/-367) Total: -18 bytes
* vi: handle chars 0x80, 0x81... correctlyDenis Vlasenko2008-10-201-61/+64
|
* Comment and whitespace tweaks.Rob Landley2008-10-191-10/+6
|
* vi: explain why reading 4 chars is unsafeDenis Vlasenko2008-10-181-3/+5
|
* vi: whitespace fixDenis Vlasenko2008-10-181-2/+2
|
* vi: a few trivial optimizations to keyboard reading code; bump timeout to 50s.Denis Vlasenko2008-10-161-18/+29
| | | | | | | | | | function old new delta edit_file 901 912 +11 count_lines 74 72 -2 readit 306 289 -17 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 1/2 up/down: 11/-19) Total: -8 bytes
* Confirmed that on Linux the serial interrupt takes precedence over the timerRob Landley2008-10-161-2/+3
| | | | | interrupt, so we don't need to worry about scheduler delays. This means the delay can be trimmed down to 25 miliseconds. Add comment while at it.
* vi: fix bizarre formatting. no code changesDenis Vlasenko2008-10-141-2/+2
|
* fix recurring "last_cmd overrun", fix [del] handling in insert modeDenis Vlasenko2008-10-141-15/+15
|
* vi: trivial size optimization -65 bytesDenis Vlasenko2008-10-141-18/+16
|
* vi: reinstate timeout of 300 msDenis Vlasenko2008-10-141-4/+8
|
* vi: add comments to Rob's algorithm of reading and matching ESC sequencesDenis Vlasenko2008-10-141-23/+33
| | | | | (nice work btw!)
* Escape sequences sent over serial links don't come in as a block, so pollRob Landley2008-10-141-1/+1
| | | | needs to pause a bit to make sure the next character has time to come in.
* Clean up editors/vi.c:readit() so it only does readahead when actuallyRob Landley2008-10-141-61/+58
| | | | | | parsing an escape sequence. (This mitigates but doesn't fully fix the the "cursoring around the file deletes data under qemu" bug, presumably due to "\033[D" being treated as three separate characters.)
* crontab: do not destroy STDIN_FILENO, editor may need it (crontab -e)Denis Vlasenko2008-09-211-23/+25
| | | | | | | | | | vi: deal with EOF/error on stdin and with input NULs function old new delta crontab_main 623 642 +19 edit_file 901 906 +5 readit 331 318 -13