summaryrefslogtreecommitdiff
path: root/src/command.c
diff options
context:
space:
mode:
authorDaniel Carl <danielcarl@gmx.de>2013-08-06 21:05:47 +0200
committerDaniel Carl <danielcarl@gmx.de>2013-08-06 21:05:47 +0200
commiteff58e8523d698eb42a1472ba9e551f12f2f8884 (patch)
treefc402b79b95e2526b95f72e8f6fddd57eed96250 /src/command.c
parent8cfde671558bbfb53bd68ec8891ca852537715f1 (diff)
Made pass through mode to a submode (#48).
This allows to use pass through mode together with insert mode. There where also some bugs around the vb_set_mode()'s handling for insert mode, that are now fixed.
Diffstat (limited to 'src/command.c')
-rw-r--r--src/command.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/command.c b/src/command.c
index 92507ee..d1cd64f 100644
--- a/src/command.c
+++ b/src/command.c
@@ -948,7 +948,14 @@ gboolean command_queue(const Arg *arg)
gboolean command_mode(const Arg *arg)
{
- return vb_set_mode(arg->i, false);
+ /* if a main mode is given - set the mode like it is */
+ if (CLEAN_MODE(arg->i)) {
+ return vb_set_mode(arg->i, false);
+ }
+
+ /* else combine the current main mode with the new submode */
+ /* TODO move this logic to main.c: vb_set_mode() */
+ return vb_set_mode(arg->i|CLEAN_MODE(vb.state.mode), false);
}
gboolean command_focusinput(const Arg *arg)