From bfb9071526d770d1d598bb8a9752313154441283 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Andr=C3=A9=20Tanner?= Date: Mon, 3 Jul 2017 23:58:13 +0200 Subject: vis: implement `gv` by means of new "^ register This window local register holds the last active selections. --- vis-registers.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'vis-registers.c') diff --git a/vis-registers.c b/vis-registers.c index 595bb5b..d20c76c 100644 --- a/vis-registers.c +++ b/vis-registers.c @@ -221,6 +221,8 @@ enum VisRegister vis_register_used(Vis *vis) { } static Register *register_from(Vis *vis, enum VisRegister id) { + if (id == VIS_REG_SELECTION && vis->win) + return &vis->win->reg_selections; if (VIS_REG_A <= id && id <= VIS_REG_Z) id = VIS_REG_a + id - VIS_REG_A; if (id < LENGTH(vis->registers)) @@ -300,4 +302,5 @@ const RegisterDef vis_registers[] = { [VIS_REG_COMMAND] = { ':', VIS_HELP("Last :-command") }, [VIS_REG_SHELL] = { '!', VIS_HELP("Last shell command given to either <, >, |, or !") }, [VIS_REG_NUMBER] = { '#', VIS_HELP("Register number") }, + [VIS_REG_SELECTION] = { '^', VIS_HELP("Last selections") }, }; -- cgit v1.2.3