mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-22 10:00:33 +00:00
Fix completion in math when inline completion was not yet shown (take 2)
Better version of b4211ef2
: we handle the case of a unique completion early.
Fixes bug #12674.
This commit is contained in:
parent
fb1c4494ea
commit
98b5a16793
@ -688,9 +688,10 @@ void GuiCompleter::tab()
|
|||||||
// If completion is active, at least complete by one character
|
// If completion is active, at least complete by one character
|
||||||
docstring prefix = cur.inset().completionPrefix(cur);
|
docstring prefix = cur.inset().completionPrefix(cur);
|
||||||
docstring completion = qstring_to_ucs4(currentCompletion());
|
docstring completion = qstring_to_ucs4(currentCompletion());
|
||||||
if (completion.size() <= prefix.size()) {
|
if (uniqueCompletionAvailable() || completion.size() <= prefix.size()) {
|
||||||
// finalize completion
|
// finalize completion
|
||||||
cur.inset().insertCompletion(cur, docstring(), true);
|
docstring const postfix = completion.substr(min(completion.size(), prefix.size()));
|
||||||
|
cur.inset().insertCompletion(cur, postfix, true);
|
||||||
|
|
||||||
// hide popup and inline completion
|
// hide popup and inline completion
|
||||||
hidePopup();
|
hidePopup();
|
||||||
|
Loading…
Reference in New Issue
Block a user