diff options
author | portix <portix@gmx.net> | 2012-11-17 01:17:34 +0100 |
---|---|---|
committer | portix <portix@gmx.net> | 2012-11-17 01:17:34 +0100 |
commit | f82b24685d481c703429fb88b3ab75ac1772dd9b (patch) | |
tree | a490b713af5d2c7d890fe8a79cd6ee44eee5cb81 /src | |
parent | 043b8c06f536a70b55f45b111159c1f703e2d0e2 (diff) | |
download | dwb-f82b24685d481c703429fb88b3ab75ac1772dd9b.zip |
Fixing wrong escaping when backslash is mapped to shortcut
Diffstat (limited to 'src')
-rw-r--r-- | src/dwb.c | 5 | ||||
-rw-r--r-- | src/scripts.c | 2 |
2 files changed, 5 insertions, 2 deletions
@@ -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); |