InputHandler: tweak prefix completion behaviour
This commit is contained in:
parent
158f5a5c84
commit
afc8ad77e8
|
@ -353,10 +353,10 @@ public:
|
||||||
context.ui().menu_show(candidates, menu_pos, MenuStyle::Prompt);
|
context.ui().menu_show(candidates, menu_pos, MenuStyle::Prompt);
|
||||||
|
|
||||||
bool use_common_prefix = context.options()["complete_prefix"].as_int();
|
bool use_common_prefix = context.options()["complete_prefix"].as_int();
|
||||||
String prefix = use_common_prefix ?
|
String prefix = use_common_prefix ? common_prefix(candidates) : String();
|
||||||
common_prefix(candidates)
|
if (m_completions.end - m_completions.start > prefix.length())
|
||||||
: line.substr(m_completions.start,
|
prefix = line.substr(m_completions.start,
|
||||||
m_completions.end - m_completions.start);
|
m_completions.end - m_completions.start);
|
||||||
|
|
||||||
auto it = find(candidates, prefix);
|
auto it = find(candidates, prefix);
|
||||||
if (it == candidates.end())
|
if (it == candidates.end())
|
||||||
|
|
Loading…
Reference in New Issue
Block a user