diff options
author | portix <portix@gmx.net> | 2012-07-16 20:29:22 +0200 |
---|---|---|
committer | portix <portix@gmx.net> | 2012-07-16 20:29:22 +0200 |
commit | 0590cc0222dafe8a22d015e112cb53c55a21d1ef (patch) | |
tree | 355250b358a755ef1c6385fdf25d4326c8d11521 /src | |
parent | e77273477f17148da1c95047ef48dda1e1ef2b64 (diff) | |
download | dwb-0590cc0222dafe8a22d015e112cb53c55a21d1ef.zip |
Check if second argument is a function in signals.connect before connecting to the signal
Diffstat (limited to 'src')
-rw-r--r-- | src/callback.c | 3 | ||||
-rw-r--r-- | src/dwb.h | 1 | ||||
-rw-r--r-- | src/scripts.c | 5 |
3 files changed, 8 insertions, 1 deletions
diff --git a/src/callback.c b/src/callback.c index 05876829..33f14600 100644 --- a/src/callback.c +++ b/src/callback.c @@ -95,6 +95,9 @@ callback_entry_key_press(GtkWidget* entry, GdkEventKey *e) { completion_buffer_key_press(e); return true; } + else if (mode & COMPLETE_SCRIPTS && !DWB_COMPLETE_KEY(e)) { + return dwb.state.script_comp_readonly; + } else if (e->keyval == GDK_KEY_BackSpace && !complete) { return false; } @@ -583,6 +583,7 @@ struct _State { unsigned int bar_visible; gboolean auto_insert_mode; GList *script_completion; + gboolean script_comp_readonly; gint last_tab; gboolean do_not_track; diff --git a/src/scripts.c b/src/scripts.c index f66e7340..2c8960be 100644 --- a/src/scripts.c +++ b/src/scripts.c @@ -822,7 +822,10 @@ global_tab_complete(JSContextRef ctx, JSObjectRef f, JSObjectRef thisObject, siz js_make_exception(ctx, exc, EXCEPTION("tabComplete: arguments[2] is not a function.")); return JSValueMakeUndefined(ctx); } - + dwb.state.script_comp_readonly = false; + if (argc > 3 && JSValueIsBoolean(ctx, argv[3])) { + dwb.state.script_comp_readonly = JSValueToBoolean(ctx, argv[3]); + } char *left, *right, *label; js_array_iterator iter; JSValueRef val; |