1
0
mirror of https://github.com/weechat/weechat.git synced 2026-07-05 01:03:14 +02:00

core: add new option weechat.completion.base_word_until_cursor: allow completion in middle of words (enabled by default) (task #9771)

This commit is contained in:
Sebastien Helleu
2011-11-12 16:09:14 +01:00
parent c8cf55c291
commit c7a1a01d8f
18 changed files with 106 additions and 15 deletions
+13 -4
View File
@@ -686,12 +686,21 @@ gui_completion_find_context (struct t_gui_completion *completion,
}
pos_start = i + 1;
}
i = pos;
while ((i < size) && (data[i] != ' '))
if (CONFIG_BOOLEAN (config_completion_base_word_until_cursor))
{
i++;
/* base word stops at cursor */
pos_end = pos - 1;
}
else
{
/* base word stops after first space found (on or after cursor) */
i = pos;
while ((i < size) && (data[i] != ' '))
{
i++;
}
pos_end = i - 1;
}
pos_end = i - 1;
if (completion->context == GUI_COMPLETION_COMMAND)
{