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 /main.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 'main.c')
| -rw-r--r-- | main.c | 21 |
1 files changed, 0 insertions, 21 deletions
@@ -114,8 +114,6 @@ static const char *movement(Vis*, const char *keys, const Arg *arg); static const char *textobj(Vis*, const char *keys, const Arg *arg); /* move to the other end of selected text */ static const char *selection_end(Vis*, const char *keys, const Arg *arg); -/* restore least recently used selection */ -static const char *selection_restore(Vis*, const char *keys, const Arg *arg); /* use register indicated by keys for the current operator */ static const char *reg(Vis*, const char *keys, const Arg *arg); /* perform arg->i motion with a mark indicated by keys as argument */ @@ -265,7 +263,6 @@ enum { VIS_ACTION_PROMPT_SHOW, VIS_ACTION_REPEAT, VIS_ACTION_SELECTION_FLIP, - VIS_ACTION_SELECTION_RESTORE, VIS_ACTION_WINDOW_REDRAW_TOP, VIS_ACTION_WINDOW_REDRAW_CENTER, VIS_ACTION_WINDOW_REDRAW_BOTTOM, @@ -913,11 +910,6 @@ static const KeyAction vis_action[] = { VIS_HELP("Flip selection, move cursor to other end") selection_end, }, - [VIS_ACTION_SELECTION_RESTORE] = { - "vis-selection-restore", - VIS_HELP("Restore last selection") - selection_restore, - }, [VIS_ACTION_WINDOW_REDRAW_TOP] = { "vis-window-redraw-top", VIS_HELP("Redraw cursor line at the top of the window") @@ -2025,19 +2017,6 @@ static const char *selection_end(Vis *vis, const char *keys, const Arg *arg) { return keys; } -static const char *selection_restore(Vis *vis, const char *keys, const Arg *arg) { - Text *txt = vis_text(vis); - View *view = vis_view(vis); - for (Selection *s = view_selections(view); s; s = view_selections_next(s)) - view_selections_restore(s); - Filerange sel = view_selection_get(view); - if (text_range_is_linewise(txt, &sel)) - vis_mode_switch(vis, VIS_MODE_VISUAL_LINE); - else - vis_mode_switch(vis, VIS_MODE_VISUAL); - return keys; -} - static const char *reg(Vis *vis, const char *keys, const Arg *arg) { if (!keys[0]) return NULL; |
