Clear inserted_ranges after updating insert completions candidates
They were getting out-of-sync with the stored timestamp, leading to invalid ranges being computed and crashes. Fixes #3666 Fixes #3571
This commit is contained in:
parent
4e4a65e944
commit
1020438462
|
@ -473,6 +473,7 @@ void InsertCompleter::reset()
|
|||
|
||||
m_explicit_completer = nullptr;
|
||||
m_completions = InsertCompletion{};
|
||||
m_inserted_ranges.clear();
|
||||
if (m_context.has_client())
|
||||
{
|
||||
m_context.client().menu_hide();
|
||||
|
@ -563,6 +564,7 @@ bool InsertCompleter::try_complete(Func complete_func)
|
|||
auto& sels = m_context.selections();
|
||||
try
|
||||
{
|
||||
m_inserted_ranges.clear();
|
||||
m_completions = complete_func(sels, m_options, m_faces);
|
||||
}
|
||||
catch (runtime_error& e)
|
||||
|
|
Loading…
Reference in New Issue
Block a user