diff options
| author | Marc André Tanner <mat@brain-dump.org> | 2016-08-24 11:03:09 +0200 |
|---|---|---|
| committer | Marc André Tanner <mat@brain-dump.org> | 2016-08-24 11:10:00 +0200 |
| commit | 1cc8afb756839d4e336c1151caecc400ac8d730a (patch) | |
| tree | b1e87a4a30da6f21955e2f3b9a31e981ea986c9a | |
| parent | 9091346d44f5b1e6f61249feede28846d22351f0 (diff) | |
| download | vis-1cc8afb756839d4e336c1151caecc400ac8d730a.tar.gz vis-1cc8afb756839d4e336c1151caecc400ac8d730a.tar.xz | |
vis: add vis_mode_get function
| -rw-r--r-- | vis-modes.c | 4 | ||||
| -rw-r--r-- | vis.h | 1 |
2 files changed, 5 insertions, 0 deletions
diff --git a/vis-modes.c b/vis-modes.c index fa69d24..967feb9 100644 --- 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); } @@ -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. */ |
