Fix completion menu not getting hidden on no matches
This commit is contained in:
parent
4499b26ca4
commit
5e4e23289b
|
@ -1132,6 +1132,9 @@ private:
|
||||||
line.byte_count_to(m_line_editor.cursor_pos()));
|
line.byte_count_to(m_line_editor.cursor_pos()));
|
||||||
if (not context().has_client())
|
if (not context().has_client())
|
||||||
return;
|
return;
|
||||||
|
if (m_completions.candidates.empty())
|
||||||
|
return context().client().menu_hide();
|
||||||
|
|
||||||
show_completions();
|
show_completions();
|
||||||
const bool menu = (bool)(m_completions.flags & Completions::Flags::Menu);
|
const bool menu = (bool)(m_completions.flags & Completions::Flags::Menu);
|
||||||
if (menu)
|
if (menu)
|
||||||
|
@ -1148,9 +1151,6 @@ private:
|
||||||
|
|
||||||
void show_completions()
|
void show_completions()
|
||||||
{
|
{
|
||||||
if (m_completions.candidates.empty())
|
|
||||||
return context().client().menu_hide();
|
|
||||||
|
|
||||||
Vector<DisplayLine> items;
|
Vector<DisplayLine> items;
|
||||||
for (auto& candidate : m_completions.candidates)
|
for (auto& candidate : m_completions.candidates)
|
||||||
items.push_back({ candidate, {} });
|
items.push_back({ candidate, {} });
|
||||||
|
@ -1183,7 +1183,7 @@ private:
|
||||||
display();
|
display();
|
||||||
if (from_pop)
|
if (from_pop)
|
||||||
{
|
{
|
||||||
if (context().has_client())
|
if (context().has_client() and not m_completions.candidates.empty())
|
||||||
{
|
{
|
||||||
show_completions();
|
show_completions();
|
||||||
const bool menu = (bool)(m_completions.flags & Completions::Flags::Menu);
|
const bool menu = (bool)(m_completions.flags & Completions::Flags::Menu);
|
||||||
|
|
Loading…
Reference in New Issue
Block a user