aboutsummaryrefslogtreecommitdiff
path: root/editor.h
diff options
context:
space:
mode:
authorMarc André Tanner <mat@brain-dump.org>2015-10-14 23:00:47 +0200
committerMarc André Tanner <mat@brain-dump.org>2015-10-14 23:17:15 +0200
commit632b5909af96861c881865afae8638a2fd072668 (patch)
tree22c745db9a95d6a8c999f0026a3d2e2301d95100 /editor.h
parentfc8b564ab2a58cf5dd19dcaabd460b65bd5d444c (diff)
downloadvis-632b5909af96861c881865afae8638a2fd072668.tar.gz
vis-632b5909af96861c881865afae8638a2fd072668.tar.xz
vis: introduce special keys which allow mappings to editor actions
Key bindings in vis are always recursive, hence mapping ~ to ~l will cause an infinite loop. Instead vis supports special editor "keys" which map to internal editor functions. As an example one can thus map ~ to <vis-operator-case-swap>l or even <vis-operator-case-swap><cursor-char-next> Furthermore this makes it possible to completely unmap core editor features such as operators, the corresponding funtionality is still available via its corresponding special key.
Diffstat (limited to 'editor.h')
-rw-r--r--editor.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/editor.h b/editor.h
index 87d9aeb..e7b5f0a 100644
--- a/editor.h
+++ b/editor.h
@@ -253,6 +253,7 @@ struct Editor {
volatile sig_atomic_t cancel_filter; /* abort external command */
volatile sig_atomic_t sigbus;
sigjmp_buf sigbus_jmpbuf;
+ Map *actions; /* built in special editor keys / commands */
};
Editor *editor_new(Ui*);
@@ -266,6 +267,8 @@ bool editor_mode_bindings(Mode*, KeyBinding**);
bool editor_mode_map(Mode*, const char *name, KeyBinding*);
bool editor_mode_unmap(Mode*, const char *name);
+bool editor_action_register(Editor*, KeyAction*);
+
/* these function operate on the currently focused window but make sure
* that all windows which show the affected region are redrawn too. */
void editor_insert_key(Editor*, const char *data, size_t len);