From bf52c0cb95b76b4ae17f138c9d98552c38185f46 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Andr=C3=A9=20Tanner?= Date: Sun, 3 Apr 2016 22:08:10 +0200 Subject: sam: focus first cursor after a x, y, g, v command --- sam.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sam.c b/sam.c index 0b04b55..79b8980 100644 --- a/sam.c +++ b/sam.c @@ -908,6 +908,8 @@ static bool cmd_select(Vis *vis, Win *win, Command *cmd, const char *argv[], Cur View *view = win->view; Text *txt = win->file->text; bool multiple_cursors = view_cursors_multiple(view); + Cursor *primary = view_cursors_primary_get(view); + for (Cursor *c = view_cursors(view), *next; c; c = next) { next = view_cursors_next(c); Filerange sel; @@ -926,6 +928,8 @@ static bool cmd_select(Vis *vis, Win *win, Command *cmd, const char *argv[], Cur ret &= sam_execute(vis, win, cmd->cmd, c, &sel); } + if (primary != view_cursors_primary_get(view)) + view_cursors_primary_set(view_cursors(view)); return ret; } -- cgit v1.2.3