From afb87c6d29275e18faec6a8b96e7d5ab57bcb0f9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Andr=C3=A9=20Tanner?= Date: Fri, 23 Oct 2015 12:30:30 +0200 Subject: vis: begin librarization of core vis primitives --- editor.h | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'editor.h') 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 */ -- cgit v1.2.3