diff options
author | Mason Larobina <mason.larobina@gmail.com> | 2009-12-03 22:02:17 +0800 |
---|---|---|
committer | Mason Larobina <mason.larobina@gmail.com> | 2009-12-03 22:02:17 +0800 |
commit | 1cc25d8c1c98dd2c301984a2487b0d817dc96eba (patch) | |
tree | 34995f42b06477fe2879bc3a1ccc5db57612979f | |
parent | 0f0530b8f3fe95956868d755b2c833805a906728 (diff) |
The MODE_CONFIG event was triggering itself in the bind plugin.
-rw-r--r-- | examples/data/uzbl/plugins/bind.py | 3 | ||||
-rw-r--r-- | examples/data/uzbl/plugins/mode.py | 11 |
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): |