aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarc André Tanner <mat@brain-dump.org>2017-07-23 17:06:17 +0200
committerMarc André Tanner <mat@brain-dump.org>2017-07-23 17:06:36 +0200
commit33b0513d5e02019a777ec5e06c1a751fd7aeefaa (patch)
tree55c8339f3bd061427a087546ba0e1d000ebfb5e3
parentce4185782b5237aafa3de236a3f67d2a613b4f96 (diff)
downloadvis-33b0513d5e02019a777ec5e06c1a751fd7aeefaa.tar.gz
vis-33b0513d5e02019a777ec5e06c1a751fd7aeefaa.tar.xz
vis: only draw selections of currently active window
This should make it easier to see which window is focused.
-rw-r--r--vis.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/vis.c b/vis.c
index 1ce9cba..f1bc7f3 100644
--- a/vis.c
+++ b/vis.c
@@ -393,7 +393,7 @@ static void window_draw_cursor(Win *win, Selection *cur, CellStyle *style, CellS
return;
}
-static void window_draw_cursors(Win *win) {
+static void window_draw_selections(Win *win) {
View *view = win->view;
Filerange viewport = view_viewport_get(view);
bool multiple_cursors = view_selections_count(view) > 1;
@@ -438,7 +438,8 @@ void vis_window_draw(Win *win) {
window_draw_colorcolumn(win);
window_draw_cursorline(win);
- window_draw_cursors(win);
+ if (!vis->win || vis->win == win || vis->win->parent == win)
+ window_draw_selections(win);
window_draw_eof(win);
vis_event_emit(vis, VIS_EVENT_WIN_STATUS, win);