aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarc André Tanner <mat@brain-dump.org>2014-09-22 06:02:18 +0200
committerMarc André Tanner <mat@brain-dump.org>2014-09-22 06:02:18 +0200
commitddd80ea3ca108858ebd053339871c6fa251f9a8d (patch)
treeab8e37c2481936361103b1c8de715c1c51d5bf6c
parentcae527bedaf1641fff25c691524d51b1025a885e (diff)
downloadvis-ddd80ea3ca108858ebd053339871c6fa251f9a8d.tar.gz
vis-ddd80ea3ca108858ebd053339871c6fa251f9a8d.tar.xz
Fix display of selection in visual mode
-rw-r--r--window.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/window.c b/window.c
index ba47d8f..8a2ad12 100644
--- 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;