mirror of
https://github.com/irssi/irssi.git
synced 2026-08-21 01:22:26 +02:00
fix backward completion
This commit is contained in:
parent
88b1649195
commit
10f41e067e
1 changed files with 11 additions and 3 deletions
|
|
@ -229,6 +229,7 @@ char *word_complete(WINDOW_REC *window, const char *line, int *pos, int erase, i
|
||||||
g_list_first(complist);
|
g_list_first(complist);
|
||||||
want_space = last_want_space;
|
want_space = last_want_space;
|
||||||
} else {
|
} else {
|
||||||
|
int keep_word = settings_get_bool("completion_keep_word");
|
||||||
/* get new completion list */
|
/* get new completion list */
|
||||||
free_completions();
|
free_completions();
|
||||||
|
|
||||||
|
|
@ -239,10 +240,17 @@ char *word_complete(WINDOW_REC *window, const char *line, int *pos, int erase, i
|
||||||
if (complist != NULL) {
|
if (complist != NULL) {
|
||||||
/* Remove all nulls (from the signal) before doing further processing */
|
/* Remove all nulls (from the signal) before doing further processing */
|
||||||
complist = g_list_remove_all(g_list_first(complist), NULL);
|
complist = g_list_remove_all(g_list_first(complist), NULL);
|
||||||
}
|
|
||||||
|
|
||||||
if (settings_get_bool("completion_keep_word") && complist != NULL) {
|
if (keep_word) {
|
||||||
complist = g_list_append(complist, g_strdup(word));
|
complist = g_list_append(complist, g_strdup(word));
|
||||||
|
}
|
||||||
|
|
||||||
|
if (backward) {
|
||||||
|
complist = g_list_last(complist);
|
||||||
|
if (keep_word) {
|
||||||
|
complist = complist->prev;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue