diff options
| author | Marc André Tanner <mat@brain-dump.org> | 2017-07-03 23:58:13 +0200 |
|---|---|---|
| committer | Marc André Tanner <mat@brain-dump.org> | 2017-07-04 00:09:37 +0200 |
| commit | bfb9071526d770d1d598bb8a9752313154441283 (patch) | |
| tree | e0969805bb14ce5224611e8d4101e62cec0295e9 /vis-registers.c | |
| parent | 54ca598fcccff8844bfbe494cd3b325b2fea487f (diff) | |
| download | vis-bfb9071526d770d1d598bb8a9752313154441283.tar.gz vis-bfb9071526d770d1d598bb8a9752313154441283.tar.xz | |
vis: implement `gv` by means of new "^ register
This window local register holds the last active selections.
Diffstat (limited to 'vis-registers.c')
| -rw-r--r-- | vis-registers.c | 3 |
1 files changed, 3 insertions, 0 deletions
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") }, }; |
