diff options
| author | Marc André Tanner <mat@brain-dump.org> | 2017-01-10 20:57:55 +0100 |
|---|---|---|
| committer | Marc André Tanner <mat@brain-dump.org> | 2017-01-10 22:18:24 +0100 |
| commit | 68a899b8faf83cc7c0f00def991acb28dc6d7135 (patch) | |
| tree | 136912a0dbe8338c1e7a93af565b0940a5d49e20 /vis.c | |
| parent | 329d0980c79b14987cee43c70b489a5a6a09c6aa (diff) | |
| download | vis-68a899b8faf83cc7c0f00def991acb28dc6d7135.tar.gz vis-68a899b8faf83cc7c0f00def991acb28dc6d7135.tar.xz | |
vis: add valid marks to :help output
Diffstat (limited to 'vis.c')
| -rw-r--r-- | vis.c | 13 |
1 files changed, 9 insertions, 4 deletions
@@ -29,6 +29,11 @@ #include "vis-core.h" #include "sam.h" +const MarkDef vis_marks[] = { + [VIS_MARK_SELECTION_START] = { '<', "Last selection start" }, + [VIS_MARK_SELECTION_END] = { '>', "Last selection end" }, +}; + static Macro *macro_get(Vis *vis, enum VisRegister); static void macro_replay(Vis *vis, const Macro *macro); static void vis_keys_push(Vis *vis, const char *input, size_t pos, bool record); @@ -1262,10 +1267,10 @@ void vis_repeat(Vis *vis) { enum VisMark vis_mark_from(Vis *vis, char mark) { if (mark >= 'a' && mark <= 'z') return VIS_MARK_a + mark - 'a'; - else if (mark == '<') - return VIS_MARK_SELECTION_START; - else if (mark == '>') - return VIS_MARK_SELECTION_END; + for (size_t i = 0; i < LENGTH(vis_marks); i++) { + if (vis_marks[i].name == mark) + return i; + } return VIS_MARK_INVALID; } |
