vis

a vi-like editor based on Plan 9's structural regular expressions

git clone https://9o.is/git/vis.git

commit 954d99581085e54f516c20f691baec2f35edb9c8
parent 859a4c679bacf115bd4494c83a4acfb7644a939a
Author: Marc André Tanner <mat@brain-dump.org>
Date:   Sun, 23 Jul 2017 17:06:17 +0200

vis: only draw selections of currently active window

This should make it easier to see which window is focused.

Diffstat:
Mvis.c | 5+++--
1 file changed, 3 insertions(+), 2 deletions(-)

diff --git 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);