void GuiCompleter::asyncHidePopup()
{
popup()->hide();
- if (!inlineVisible())
+ // do not clear model if it has been set by an event before the
+ // timeout got triggered.
+ if (!modelActive_ && !inlineVisible())
model_->setList(0);
}
void GuiCompleter::asyncHideInline()
{
- if (!popupVisible())
+ // do not clear model if it has been set by an event before the
+ // timeout got triggered.
+ if (!modelActive_ && !popupVisible())
model_->setList(0);
}
}
// Make undo possible
- cur.beginUndoGroup();
+ UndoGroupHelper ugh;
cur.recordUndo();
// If completion is active, at least complete by one character
hidePopup();
hideInline(cur);
updateVisibility(false, false);
- cur.endUndoGroup();
return;
}
docstring nextchar = completion.substr(prefix.size(), 1);
- if (!cur.inset().insertCompletion(cur, nextchar, false)) {
- cur.endUndoGroup();
+ if (!cur.inset().insertCompletion(cur, nextchar, false))
return;
- }
updatePrefix(cur);
// try to complete as far as it is unique
// redraw if needed
if (cur.result().screenUpdate())
gui_->bufferView().processUpdateFlags(cur.result().screenUpdate());
- cur.endUndoGroup();
}