mirror of
https://git.lyx.org/repos/lyx.git
synced 2025-01-03 08:28:25 +00:00
Use UndoGroupHelper to track undo group lifetime
This commit is contained in:
parent
da79317ce2
commit
f3656600f9
@ -676,7 +676,7 @@ void GuiCompleter::tab()
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Make undo possible
|
// Make undo possible
|
||||||
cur.beginUndoGroup();
|
UndoGroupHelper ugh;
|
||||||
cur.recordUndo();
|
cur.recordUndo();
|
||||||
|
|
||||||
// If completion is active, at least complete by one character
|
// If completion is active, at least complete by one character
|
||||||
@ -690,14 +690,11 @@ void GuiCompleter::tab()
|
|||||||
hidePopup();
|
hidePopup();
|
||||||
hideInline(cur);
|
hideInline(cur);
|
||||||
updateVisibility(false, false);
|
updateVisibility(false, false);
|
||||||
cur.endUndoGroup();
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
docstring nextchar = completion.substr(prefix.size(), 1);
|
docstring nextchar = completion.substr(prefix.size(), 1);
|
||||||
if (!cur.inset().insertCompletion(cur, nextchar, false)) {
|
if (!cur.inset().insertCompletion(cur, nextchar, false))
|
||||||
cur.endUndoGroup();
|
|
||||||
return;
|
return;
|
||||||
}
|
|
||||||
updatePrefix(cur);
|
updatePrefix(cur);
|
||||||
|
|
||||||
// try to complete as far as it is unique
|
// try to complete as far as it is unique
|
||||||
@ -717,7 +714,6 @@ void GuiCompleter::tab()
|
|||||||
// redraw if needed
|
// redraw if needed
|
||||||
if (cur.result().screenUpdate())
|
if (cur.result().screenUpdate())
|
||||||
gui_->bufferView().processUpdateFlags(cur.result().screenUpdate());
|
gui_->bufferView().processUpdateFlags(cur.result().screenUpdate());
|
||||||
cur.endUndoGroup();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user