mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-12-02 14:01:10 +00:00
Respect group integrity when removing stuff from the Undo stack.
Fixes: #9079
This commit is contained in:
parent
b064f09b5a
commit
6bce9abfee
@ -160,13 +160,17 @@ public:
|
|||||||
/// Push an item on to the stack, deleting the bottom group on
|
/// Push an item on to the stack, deleting the bottom group on
|
||||||
/// overflow.
|
/// overflow.
|
||||||
void push(UndoElement const & v) {
|
void push(UndoElement const & v) {
|
||||||
c_.push_front(v);
|
// Remove some entries if the limit has been reached.
|
||||||
if (c_.size() > limit_) {
|
// However, if the only group on the stack is the one
|
||||||
|
// we are currently populating, do nothing.
|
||||||
|
if (c_.size() >= limit_
|
||||||
|
&& c_.front().group_id != v.group_id) {
|
||||||
// remove a whole group at once.
|
// remove a whole group at once.
|
||||||
const size_t gid = c_.back().group_id;
|
const size_t gid = c_.back().group_id;
|
||||||
while (!c_.empty() && c_.back().group_id == gid)
|
while (!c_.empty() && c_.back().group_id == gid)
|
||||||
c_.pop_back();
|
c_.pop_back();
|
||||||
}
|
}
|
||||||
|
c_.push_front(v);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Mark all the elements of the stack as dirty
|
/// Mark all the elements of the stack as dirty
|
||||||
|
@ -80,6 +80,8 @@ What's new
|
|||||||
|
|
||||||
- Fix select-by-doubleclick in mathed (bug 8829).
|
- Fix select-by-doubleclick in mathed (bug 8829).
|
||||||
|
|
||||||
|
- Fix undo with many individual changes (e.g. with replace all)
|
||||||
|
(bug #7079).
|
||||||
|
|
||||||
|
|
||||||
* INTERNALS
|
* INTERNALS
|
||||||
|
Loading…
Reference in New Issue
Block a user