aboutsummaryrefslogtreecommitdiffhomepage
path: root/examples
diff options
context:
space:
mode:
authorGravatar Mason Larobina <mason.larobina@gmail.com>2009-12-03 22:02:17 +0800
committerGravatar Mason Larobina <mason.larobina@gmail.com>2009-12-03 22:02:17 +0800
commit1cc25d8c1c98dd2c301984a2487b0d817dc96eba (patch)
tree34995f42b06477fe2879bc3a1ccc5db57612979f /examples
parent0f0530b8f3fe95956868d755b2c833805a906728 (diff)
The MODE_CONFIG event was triggering itself in the bind plugin.
Diffstat (limited to 'examples')
-rw-r--r--examples/data/uzbl/plugins/bind.py3
-rw-r--r--examples/data/uzbl/plugins/mode.py11
2 files changed, 7 insertions, 7 deletions
diff --git a/examples/data/uzbl/plugins/bind.py b/examples/data/uzbl/plugins/bind.py
index 517bf98..10cce6a 100644
--- a/examples/data/uzbl/plugins/bind.py
+++ b/examples/data/uzbl/plugins/bind.py
@@ -295,8 +295,9 @@ def clear_stack(uzbl):
bind_dict['depth'] = 0
bind_dict['args'] = []
if bind_dict['last_mode']:
- uzbl.set_mode(bind_dict['last_mode'])
+ mode = bind_dict['last_mode']
bind_dict['last_mode'] = ''
+ uzbl.set_mode(mode)
uzbl.set('keycmd_prompt')
diff --git a/examples/data/uzbl/plugins/mode.py b/examples/data/uzbl/plugins/mode.py
index 2b2579a..f85d999 100644
--- a/examples/data/uzbl/plugins/mode.py
+++ b/examples/data/uzbl/plugins/mode.py
@@ -58,7 +58,8 @@ def get_mode(uzbl):
def mode_changed(uzbl, mode):
'''The mode has just been changed, now set the per-mode config.'''
- get_mode_dict(uzbl)['mode'] = mode
+ if get_mode(uzbl) != mode:
+ return
config = uzbl.get_config()
mode_config = get_mode_config(uzbl, mode)
@@ -92,12 +93,10 @@ def set_mode(uzbl, mode=None):
if 'mode' not in config or config['mode'] != mode:
config['mode'] = mode
- return
-
- elif get_mode(uzbl) == mode:
- return
- uzbl.event("MODE_CHANGED", mode)
+ elif mode_dict['mode'] != mode:
+ mode_dict['mode'] = mode
+ uzbl.event("MODE_CHANGED", mode)
def config_changed(uzbl, key, value):