summaryrefslogtreecommitdiff
path: root/src/ex.h
diff options
context:
space:
mode:
authorDaniel Carl <danielcarl@gmx.de>2013-08-14 20:15:06 +0200
committerDaniel Carl <danielcarl@gmx.de>2013-09-20 00:58:07 +0200
commit46f8678f4600ca7c1566f483cbee143ed6294772 (patch)
tree4510df6626f02e5b07e00331a3f81b034442001e /src/ex.h
parent6ae1f47d8eab6229c96f4ff0ec2a51b83aa1ab75 (diff)
Changed the way keys are processed.
Until today vimb mapped two-part keybindings to commands. This patch changed this paradigm into a more vi like way. The commands are separated into normal mode commands that mainly consists of a single char and ex commands that can by typed into the inputbox like ':open'. This change allows us to adapt also the way keypresses and mapping are handled. Now every keypress is converted into a unsigned char and collected into a typeahead queue. The mappings are applied on the queue. So now we can use also long keymaps and run multiple commands for different modes with them like ':nmap abcdef :set scripts!<CR>:open search query<CR>50G'.
Diffstat (limited to 'src/ex.h')
-rw-r--r--src/ex.h33
1 files changed, 33 insertions, 0 deletions
diff --git a/src/ex.h b/src/ex.h
new file mode 100644
index 0000000..acb71e6
--- /dev/null
+++ b/src/ex.h
@@ -0,0 +1,33 @@
+/**
+ * vimb - a webkit based vim like browser.
+ *
+ * Copyright (C) 2012-2013 Daniel Carl
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see http://www.gnu.org/licenses/.
+ */
+
+#ifndef _EX_H
+#define _EX_H
+
+#include "config.h"
+#include "main.h"
+
+void ex_enter(void);
+void ex_leave(void);
+VbResult ex_keypress(unsigned int key);
+void ex_input_changed(const char *text);
+gboolean ex_fill_completion(GtkListStore *store, const char *input);
+gboolean ex_run_string(const char *input);
+
+#endif /* end of include guard: _EX_H */