summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/callback.c3
-rw-r--r--src/dwb.h1
-rw-r--r--src/scripts.c5
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;
}
diff --git a/src/dwb.h b/src/dwb.h
index 354bb6cf..9ed045f7 100644
--- a/src/dwb.h
+++ b/src/dwb.h
@@ -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;