vis

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

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

commit 0c6da7957b7399ca698bbfdf17604ccdc04f34ed
parent 7c4ae8d4e4331799c16a0658c14d8dd484a2dbd0
Author: Marc André Tanner <mat@brain-dump.org>
Date:   Fri, 18 May 2018 17:12:27 +0200

sam: normalize selections after command execution

As a trivial example if multiple selections exist running a command like

 :,

should merge them.

Diffstat:
Msam.c | 3+++
1 file changed, 3 insertions(+), 0 deletions(-)

diff --git a/sam.c b/sam.c @@ -1244,6 +1244,9 @@ enum SamError sam_cmd(Vis *vis, const char *s) { vis_file_snapshot(vis, file); } + for (Win *win = vis->windows; win; win = win->next) + view_selections_normalize(win->view); + if (vis->win) { if (primary_pos != EPOS && view_selection_disposed(vis->win->view)) view_cursor_to(vis->win->view, primary_pos);