From 27963676b649c37a31bfd7cfa4e3b14298666243 Mon Sep 17 00:00:00 2001 From: "Michael D. Lowis" Date: Tue, 30 May 2017 11:13:53 -0400 Subject: [PATCH] fixed logic for clearing a selection on moving with the arrow keys --- TODO.md | 1 - lib/view.c | 1 + 2 files changed, 1 insertion(+), 1 deletion(-) 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 -- 2.52.0