aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar Mason Larobina <mason.larobina@gmail.com>2010-01-24 22:16:21 +0800
committerGravatar Mason Larobina <mason.larobina@gmail.com>2010-01-24 22:16:21 +0800
commitddf6cfbb7f85ae994681e2578d230563baa419f4 (patch)
treedcd8ea9a5dfa609ea3f86a7d4a3ccfccec8a55f4
parent1e34a994e7ce556c45a7fd294c35a085c12b504c (diff)
Consistency fix in the bind plugin with regard to '*' binds.
The problem (as highlighted by the link following scripts) was that when the user enters a stack bind (like a "fl<link:>*" bind) that binds command isn't executed with a null argument. When you do the equivalent without stack binds (like a "fl*" bind) that binds command is executed with a null argument as soon as you type "fl". This behaviour is useful and exploited heavily by the link following scripts which use the null argument as a trigger to "numberize" all the links in the visible area.
-rw-r--r--examples/data/plugins/bind.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/examples/data/plugins/bind.py b/examples/data/plugins/bind.py
index 1dd2ee8..a1a5d89 100644
--- a/examples/data/plugins/bind.py
+++ b/examples/data/plugins/bind.py
@@ -431,6 +431,10 @@ def match_and_exec(uzbl, bind, depth, keylet, bindlet):
elif more:
bindlet.stack(bind, args, depth)
+ (on_exec, has_args, mod_cmd, glob, more) = bind[depth+1]
+ if not on_exec and has_args and not glob and not more:
+ exec_bind(uzbl, bind, *(args+['',]))
+
return False
args = bindlet.args + args