From d0c25e3cb12f6905a68952b0eeb9c17f6edcee48 Mon Sep 17 00:00:00 2001 From: Kaz Kylheku Date: Tue, 22 Sep 2015 06:04:04 -0700 Subject: linenoise: selection endpoint toggle with Ctrl-^. * linenoise/linenoise.c (edit): Implemented. * txr.1: Documented. --- linenoise/linenoise.c | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'linenoise/linenoise.c') 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); -- cgit v1.2.3