Add escape_string_escape function for expand_escapes

To avoid expanding, tab completion escapes the completion list. But the
escape_string function escapes too much for the expand_escapes code. Add
a function that only escapes the backslashes.
This commit is contained in:
ailin-nemui 2018-11-25 13:41:46 +01:00
commit 7e6e3cd503
3 changed files with 20 additions and 1 deletions

View file

@ -256,7 +256,7 @@ char *word_complete(WINDOW_REC *window, const char *line, int *pos, int erase, i
/* escape if the word doesn't begin with '/' and expand_escapes are turned on */
data = strchr(cmdchars, *line) == NULL && expand_escapes ?
escape_string(complist->data) : g_strdup(complist->data);
escape_string_escape(complist->data) : g_strdup(complist->data);
/* word completed */
*pos = startpos + strlen(data);