From 1cc25d8c1c98dd2c301984a2487b0d817dc96eba Mon Sep 17 00:00:00 2001 From: Mason Larobina Date: Thu, 3 Dec 2009 22:02:17 +0800 Subject: The MODE_CONFIG event was triggering itself in the bind plugin. --- examples/data/uzbl/plugins/bind.py | 3 ++- examples/data/uzbl/plugins/mode.py | 11 +++++------ 2 files changed, 7 insertions(+), 7 deletions(-) (limited to 'examples') 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): -- cgit v1.2.3