aboutsummaryrefslogtreecommitdiff
path: root/editor.c
diff options
context:
space:
mode:
Diffstat (limited to 'editor.c')
-rw-r--r--editor.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/editor.c b/editor.c
index c07eed7..4484b0a 100644
--- a/editor.c
+++ b/editor.c
@@ -252,6 +252,14 @@ bool editor_mode_unmap(Mode *mode, const char *name) {
return map_delete(mode->bindings, name);
}
+bool editor_action_register(Editor *ed, KeyAction *action) {
+ if (!ed->actions)
+ ed->actions = map_new();
+ if (!ed->actions)
+ return false;
+ return map_put(ed->actions, action->name, action);
+}
+
static void window_free(Win *win) {
if (!win)
return;
@@ -430,6 +438,7 @@ void editor_free(Editor *ed) {
ed->ui->free(ed->ui);
map_free(ed->cmds);
map_free(ed->options);
+ map_free(ed->actions);
buffer_release(&ed->buffer_repeat);
free(ed);
}