vis
a vi-like editor based on Plan 9's structural regular expressions
git clone https://9o.is/git/vis.git
commit 323ef825758316811b824bad5b4410747acff5dc parent 325665e27c33f45b6bacee5829715325d016b49a Author: Marc André Tanner <mat@brain-dump.org> Date: Mon, 22 Sep 2014 06:02:18 +0200 Fix display of selection in visual mode Diffstat:
| M | window.c | | | 9 | +++++---- |
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/window.c b/window.c @@ -406,9 +406,6 @@ void window_draw(Win *win) { } } - if (sel.start <= pos && pos < sel.end) - attrs |= A_REVERSE; - size_t len = mbrtowc(&c.wchar, cur, rem, NULL); if (len == (size_t)-1 && errno == EILSEQ) { /* ok, we encountered an invalid multibyte sequence, @@ -442,7 +439,11 @@ void window_draw(Win *win) { c = (Char){ .c = "\n", .wchar = L'\n', .len = len }; } - wattrset(win->win, attrs); + if (sel.start <= pos && pos < sel.end) + wattrset(win->win, attrs | A_REVERSE); + else + wattrset(win->win, attrs); + if (!window_addch(win, &c)) break;