summaryrefslogtreecommitdiff
path: root/bin/ksh/vi.c
AgeCommit message (Collapse)Author
2021-03-12Provide definition of CTRL in vi.c like we do for emacs.c.Todd C. Miller
Fixes a portability issue. From Benjamin Baier
2021-03-10Add support for ^R (redraw) in insert mode too.Todd C. Miller
From gotroyb127, OK tb@
2021-03-10Fix redrawing of a multiline PS1 prompt in vi mode.Todd C. Miller
From gotroyb127 OK tb@
2020-09-20Clear screen before redrawing the line with ^L, also in input mode.Todd C. Miller
This is similar to the emacs mode clear-screen command. Unlike bash, but like zsh, ^L also works in input mode, not just command mode. OK kn@ tb@
2018-03-15Favor usage of __func__ in warning/error messages. Some of them referred to theanton
wrong function and fix the rest for consistency. Diff from Michael W. Bombardieri with some cosmetic cleanup applied. ok benno@ tb@
2018-01-16Introduce internal_warningf() and mark internal_errorf() as noreturnJeremie Courreges-Anglas
This helps tools like scan-build, and follows the example of warningf() and errorf(). ok anton@
2018-01-13remove unused parameter from the static function print_expansions();Ingo Schwarze
patch from Michael W. Bombardieri <mb at ii dot net>; OK tb@
2018-01-06Bring back the sign compare changes, this time with a fix from otto@Todd C. Miller
that fixes the issues seen on hppa. OK deraadt@ otto@
2018-01-04Back out sign compare changes that appear to cause problems on hppa.Todd C. Miller
Requested by deraadt@
2018-01-01Add WARNINGS=yes to ksh and fix the resulting sign compare warnings.Todd C. Miller
OK tb@
2017-11-27Follow emacs mode and remove the interactive "version" function.Theo Buehler
ok jca, anton (who both had the same diff) and deraadt
2017-09-02whitespace commit from BCTheo de Raadt
2017-06-29Increase the input line buffer to 4096 bytes.Martijn van Duren
Sounds good to deraadt@ OK anton@
2017-05-31Let the 's' command delete the right number of bytes when UTF-8Ingo Schwarze
characters are involved; similar to what anton@ previously did for 'r'; OK tb@ anton@; also tested by Walter Alejandro Iglesias <wai at roquesor dot com>.
2017-05-31Allow replacement of UTF-8 characters in vi mode.anton
Reported by Walter Alejandro Iglesias on tech@. ok schwarze@ tb@
2017-05-28Fix cursor position while removing characters from the command line.anton
While here, remove a condition that becomes redundant. ok schwarze@ tb@
2016-10-17simplify implementation of the '$' command, no functional change;Ingo Schwarze
OK nicm@ tb@ czarkoff@
2016-10-17resolve code duplication in domove() for the commands: b B w WIngo Schwarze
no functional change; suggested by tb@
2016-10-17No need to inspect LC_CTYPE:Ingo Schwarze
* It was only used in vi input mode. * No functional change in case of set -o vi-show8. * No functional change if LC_CTYPE is set to UTF-8. * More robust for the default of LC_CTYPE=C on a UTF-8 xterm. Behaviour changes for the combination LC_CTYPE=C with set +o vi-show8 on non-UTF-8 terminals, but that combination is useless and dangerous with or without this patch. If you want to edit individual raw non-ASCII non-UTF-8 bytes on the shell command line, always use set -o vi-show8. (Besides, i doubt that you actually want to do that; better use a real hex editor in the first place.) OK czarkoff@.
2016-10-17Make sure the cursor goes to the first byte of a UTF-8 characterIngo Schwarze
and not to a continuation byte for these commands: b B e E w W | Let {e,E}ndword return the position after the word because that is easier to handle in the caller. OK tb@ czarkoff@
2016-10-11Partial UTF-8 line editing support for ksh(1) vi input mode;Ingo Schwarze
so far, it covers these commands: a h i l x / This is an isu8cont()-based hack similar in style to what i did in emacs input mode, but less elegant and slightly more intrusive because the vi mode code is much more ugly and less straightforward than the emacs mode code. This one required partial rewrites of a few helper functions, and comments were added while there. This is not perfect, but hopefully reduces people's cursing until a more rigorous solution can be devised (much) later. Some polishing may be useful in tree, in particular adding utf8cont() support to a few missing commands. Mostly written shortly after Christmas 2015. Reminded by and OK czarkoff@. Feedback, partial review and testing, no longer any objection by martijn@. Feedback and testing by tb@. Also read fine to nicm@.
2015-12-22Assign pointer variables to NULL rather than 0. No functional change.mmcc
2015-11-05Capitalize entire macro name.mmcc
ok nicm@
2015-11-05Remove an alias for a macro.mmcc
ok nicm@
2015-10-19Move string.h include from sh.h to the files that use it.mmcc
ok nicm@
2015-10-19Apply style(9) to header includes.mmcc
ok nicm@
2015-10-15Introduce an unsigned char variable for the ctype function calls.mmcc
ok millert@
2015-09-18Last of the (thing *)0 -> NULL, from Michael McConville. No binaryNicholas Marriott
change.
2015-09-17Remove unnecessary casts, from Michael McConville. No binary change.Nicholas Marriott
2015-09-15correct spelling of NULL from (char *)0. from Michael McConville.Ted Unangst
ok md5
2015-09-10Replace newline and space defines by "\n" and " " directly, from MichaelNicholas Marriott
McConville. ok millert
2015-09-01remove casts and null checks before free. from Michael McConvilleTed Unangst
ok deraadt
2013-12-18incorrect cast for ctype, spotted and repaired by LEVAI DanielTheo de Raadt
2013-12-17ctype cleanups. Repeated re-audits of this sensitive area by okan andTheo de Raadt
myself, with a variety of other people spending some time as well. Thanks.
2009-06-29make VSEARCH werase act like regular werase after the last change.Martynas Venckus
vi back-words and emacs kill-region are not completely the same. ok merdely@, millert@. "Get it in" Darrin Chandler
2009-06-10Fix problem with ^w fix that broke 'B'Michael Erdely
Found by Daniel LEVAI Fix by Darrin Chandler ok millert@
2009-06-04"make ksh vi mode handle werase more like vi. It's really irritating toMichael Erdely
have whole paths go away on ^W instead of just the last bit." "That looks right to me" millert@, "YES kthx bye!" thib@
2006-04-10fix lint comments, no functional changes; ok rayJared Yanovich
2005-12-11fix a few name clashes with libc; found by lint. ok deraadt@Otto Moerbeek
2005-03-30lots of indentation cleanup, now ksh is readable like our other code.Theo de Raadt
double checked to make sure no binaries change, and eyed by niallo
2005-03-28spacingTheo de Raadt
2005-01-27fix some vi-mode bugs spotted by jmc@Dan Harnett
tested by jmc@, ok otto@
2004-12-22Use stdbool.h instead of rolling our own bools.Todd C. Miller
2004-12-20Ansification plus some minor knf. No binary change on i386 andOtto Moerbeek
sparc64, binary change in lex.o on macppc due to introduction of dopprompt() prototype. ok millert@
2004-12-19spacingTheo de Raadt
2004-12-18deregisterTodd C. Miller
2004-12-18Remove unused OS dependent #ifdef blocks, #defines and macro abstraction.Todd C. Miller
First step in making the ksh code easier to read. From Matthias Kilian
2004-05-10double the command line buffer size (1024 -> 2048); ok millert deraadtPeter Valchev
2003-10-16Buffers are not strings so use memcpy(), not strlcpy() to copy them.Todd C. Miller
Found by danh@ with JG malloc options. I've also added some further bounds checks in the name of paranoia. Tested by danh and others.
2003-03-13a few strcpy -> strlcpy; a couple people have mailed in a variety ofTheo de Raadt
patches, and i already had this sitting on my laptop at that time.. i used that as a chance to note that we had all done the same work, more or less