summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorportix <portix@gmx.net>2012-11-17 01:17:34 +0100
committerportix <portix@gmx.net>2012-11-17 01:17:34 +0100
commitf82b24685d481c703429fb88b3ab75ac1772dd9b (patch)
treea490b713af5d2c7d890fe8a79cd6ee44eee5cb81 /src
parent043b8c06f536a70b55f45b111159c1f703e2d0e2 (diff)
downloaddwb-f82b24685d481c703429fb88b3ab75ac1772dd9b.zip
Fixing wrong escaping when backslash is mapped to shortcut
Diffstat (limited to 'src')
-rw-r--r--src/dwb.c5
-rw-r--r--src/scripts.c2
2 files changed, 5 insertions, 2 deletions
diff --git a/src/dwb.c b/src/dwb.c
index 1e9a7781..39c00d29 100644
--- a/src/dwb.c
+++ b/src/dwb.c
@@ -3287,7 +3287,10 @@ dwb_str_to_key(char *str) {
if ((escape = strchr(start, '\\'))) {
keybuffer = g_string_new(NULL);
do {
- g_string_append_len(keybuffer, start, escape - start);
+ if (*(escape + 1) == '\\')
+ g_string_append_c(keybuffer, '\\');
+ else
+ g_string_append_len(keybuffer, start, escape - start);
start = escape + 1;
} while ((escape = strchr(start, '\\')));
g_string_append_len(keybuffer, start, escape - start);
diff --git a/src/scripts.c b/src/scripts.c
index 208223dd..4651a946 100644
--- a/src/scripts.c
+++ b/src/scripts.c
@@ -738,7 +738,7 @@ global_bind(JSContextRef ctx, JSObjectRef function, JSObjectRef thisObject, size
Key key = dwb_str_to_key(keystr);
map->key = key.str;
map->mod = key.mod;
- FunctionMap fm = { { name, callback }, option, (Func)scripts_eval_key, NULL, NEVER_SM, { .arg = func }, EP_NONE, {NULL} };
+ FunctionMap fm = { { name, callback }, option, (Func)scripts_eval_key, NULL, ALWAYS_SM, { .arg = func }, EP_NONE, {NULL} };
*fmap = fm;
map->map = fmap;
dwb.keymap = g_list_prepend(dwb.keymap, map);