From: Michael D. Lowis Date: Tue, 30 May 2017 15:13:53 +0000 (-0400) Subject: fixed logic for clearing a selection on moving with the arrow keys X-Git-Url: https://git.mdlowis.com/?a=commitdiff_plain;h=27963676b649c37a31bfd7cfa4e3b14298666243;p=projs%2Ftide.git fixed logic for clearing a selection on moving with the arrow keys --- diff --git a/TODO.md b/TODO.md index 45560d3..1b39ab2 100644 --- a/TODO.md +++ b/TODO.md @@ -5,7 +5,6 @@ Up Next: * move by words is inconsistent. Example: var infoId = 'readerinfo'+reader.id; * Add a way to CD using a builtin (buffers will track original dir) -* selection of size 1 and arrow keys moves wrong direction * cd to root in xcpd * Ctrl+; Shortcut to warp cursor to middle of current screen. * shortcut to jump to previous edit diff --git a/lib/view.c b/lib/view.c index 6d330ac..e682c12 100644 --- a/lib/view.c +++ b/lib/view.c @@ -264,6 +264,7 @@ Row* view_getrow(View* view, size_t row) { void view_byrune(View* view, int move, bool extsel) { Sel sel = view->selection; if (view_selsize(view) && !extsel) { + selswap(&sel); if (move == RIGHT) sel.beg = sel.end; else