vis
a vi-like editor based on Plan 9's structural regular expressions
git clone https://9o.is/git/vis.git
commit 8e88b90747fd03217138615737f688888114b9ef parent caca5803c737b0d83e8da5733e10e57b413bdd8d Author: Marc André Tanner <mat@brain-dump.org> Date: Wed, 24 Aug 2016 11:03:09 +0200 vis: add vis_mode_get function Diffstat:
| M | vis-modes.c | | | 4 | ++++ |
| M | vis.h | | | 1 | + |
2 files changed, 5 insertions(+), 0 deletions(-)
diff --git a/vis-modes.c b/vis-modes.c @@ -26,6 +26,10 @@ void vis_mode_switch(Vis *vis, enum VisMode mode) { mode_set(vis, &vis_modes[mode]); } +enum VisMode vis_mode_get(Vis *vis) { + return vis->mode->id; +} + static bool mode_unmap(Mode *mode, const char *key) { return mode && mode->bindings && map_delete(mode->bindings, key); } diff --git a/vis.h b/vis.h @@ -153,6 +153,7 @@ enum VisMode { }; void vis_mode_switch(Vis*, enum VisMode); +enum VisMode vis_mode_get(Vis*); /* In the specified mode: map a given key to a binding (binding->key is ignored). * Fails if a prefix of `key' is already mapped and `force' is false. Otherwise * all such prefixes are unmapped. */