diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2015-09-22 06:04:04 -0700 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2015-09-22 06:04:04 -0700 |
commit | d0c25e3cb12f6905a68952b0eeb9c17f6edcee48 (patch) | |
tree | 347f2e5aae2d4c42f0b18c9be5021a00e090f141 /linenoise/linenoise.c | |
parent | caca753c5fef9c52a3fda44f31ca86be0d36509e (diff) | |
download | txr-d0c25e3cb12f6905a68952b0eeb9c17f6edcee48.tar.gz txr-d0c25e3cb12f6905a68952b0eeb9c17f6edcee48.tar.bz2 txr-d0c25e3cb12f6905a68952b0eeb9c17f6edcee48.zip |
linenoise: selection endpoint toggle with Ctrl-^.
* linenoise/linenoise.c (edit): Implemented.
* txr.1: Documented.
Diffstat (limited to 'linenoise/linenoise.c')
-rw-r--r-- | linenoise/linenoise.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/linenoise/linenoise.c b/linenoise/linenoise.c index 782fdfde..7dd29aa5 100644 --- a/linenoise/linenoise.c +++ b/linenoise/linenoise.c @@ -1870,6 +1870,15 @@ static int edit(lino_t *l, const char *prompt) l->dsel = l->dend = l->dpos; l->need_refresh = 1; break; + case CTL('^'): + if (l->selmode) + { + size_t tmp = l->dsel; + l->dsel = l->dend; + l->dend = l->dpos = tmp; + l->need_refresh = 1; + } + break; case CTL('Y'): yank_sel(l); clear_sel(l); |