aboutsummaryrefslogtreecommitdiff
path: root/editor.h
diff options
context:
space:
mode:
authorMarc André Tanner <mat@brain-dump.org>2015-10-23 12:30:30 +0200
committerMarc André Tanner <mat@brain-dump.org>2015-10-23 23:01:56 +0200
commitafb87c6d29275e18faec6a8b96e7d5ab57bcb0f9 (patch)
tree1cd7e0ab6a3a10347547a232e187838a6ca5957f /editor.h
parent5ae02ee68bd4df690d7ebcd6c8a0eb36fcf71835 (diff)
downloadvis-afb87c6d29275e18faec6a8b96e7d5ab57bcb0f9.tar.gz
vis-afb87c6d29275e18faec6a8b96e7d5ab57bcb0f9.tar.xz
vis: begin librarization of core vis primitives
Diffstat (limited to 'editor.h')
-rw-r--r--editor.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/editor.h b/editor.h
index 428839b..098b7fa 100644
--- a/editor.h
+++ b/editor.h
@@ -44,6 +44,16 @@ typedef struct {
const char *alias;
} KeyBinding;
+/* a mode contains a set of key bindings which are currently valid.
+ *
+ * each mode can specify one parent mode which is consultated if a given key
+ * is not found in the current mode. hence the modes form a tree which is
+ * searched from the current mode up towards the root mode until a valid binding
+ * is found.
+ *
+ * if no binding is found, mode->input(...) is called and the user entered
+ * keys are passed as argument. this is used to change the document content.
+ */
typedef struct Mode Mode;
struct Mode {
Mode *parent; /* if no match is found in this mode, search will continue there */