mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-12-23 13:31:49 +00:00
Fix part of bug #7072 by opening undo groups as needed.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@36597 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
87a0c25bc4
commit
940ab1261b
@ -683,6 +683,7 @@ void GuiCompleter::tab()
|
||||
}
|
||||
|
||||
// Make undo possible
|
||||
cur.beginUndoGroup();
|
||||
cur.recordUndo();
|
||||
|
||||
// If completion is active, at least complete by one character
|
||||
@ -696,11 +697,14 @@ void GuiCompleter::tab()
|
||||
hidePopup(cur);
|
||||
hideInline(cur);
|
||||
updateVisibility(false, false);
|
||||
cur.endUndoGroup();
|
||||
return;
|
||||
}
|
||||
docstring nextchar = completion.substr(prefix.size(), 1);
|
||||
if (!cur.inset().insertCompletion(cur, nextchar, false))
|
||||
if (!cur.inset().insertCompletion(cur, nextchar, false)) {
|
||||
cur.endUndoGroup();
|
||||
return;
|
||||
}
|
||||
updatePrefix(cur);
|
||||
|
||||
// try to complete as far as it is unique
|
||||
@ -720,6 +724,7 @@ void GuiCompleter::tab()
|
||||
// redraw if needed
|
||||
if (cur.result().screenUpdate())
|
||||
gui_->bufferView().processUpdateFlags(cur.result().screenUpdate());
|
||||
cur.endUndoGroup();
|
||||
}
|
||||
|
||||
|
||||
@ -876,6 +881,7 @@ void GuiCompleter::popupActivated(const QString & completion)
|
||||
Cursor cur = gui_->bufferView().cursor();
|
||||
cur.screenUpdateFlags(Update::None);
|
||||
|
||||
cur.beginUndoGroup();
|
||||
cur.recordUndo();
|
||||
|
||||
docstring prefix = cur.inset().completionPrefix(cur);
|
||||
@ -886,6 +892,7 @@ void GuiCompleter::popupActivated(const QString & completion)
|
||||
|
||||
if (cur.result().screenUpdate())
|
||||
gui_->bufferView().processUpdateFlags(cur.result().screenUpdate());
|
||||
cur.endUndoGroup();
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user