]> git.lyx.org Git - features.git/commitdiff
Fix bug #8342: Endless undo group messages
authorJean-Marc Lasgouttes <lasgouttes@lyx.org>
Mon, 17 Sep 2012 09:24:39 +0000 (11:24 +0200)
committerJean-Marc Lasgouttes <lasgouttes@lyx.org>
Mon, 17 Sep 2012 21:04:42 +0000 (23:04 +0200)
Fix thinko in Undo::endUndoGroup.
Do not reset undo groups in Undo::clean

The underlying problem remains: the various VC functions should not
always reload the buffer or at least should use the parameter
clearUndo=false.

src/Undo.cpp
status.20x

index 28438c10f39711b0caa2cbcd6441a3bd6f1d6a5f..9960309d8ffaa30c9ffbb3eefe9c012638803dda 100644 (file)
@@ -249,8 +249,10 @@ void Undo::clear()
        d->undostack_.clear();
        d->redostack_.clear();
        d->undo_finished_ = true;
-       d->group_id = 0;
-       d->group_level = 0;
+       // We used to do that, but I believe it is better to keep
+       // groups (only used in Buffer::reload for now (JMarc)
+       //d->group_id = 0;
+       //d->group_level = 0;
 }
 
 
@@ -511,8 +513,10 @@ void Undo::beginUndoGroup()
 
 void Undo::endUndoGroup()
 {
-       if (d->group_level == 0)
+       if (d->group_level == 0) {
                LYXERR0("There is no undo group to end here");
+               return;
+       }
        --d->group_level;
        if (d->group_level == 0) {
                // real end of the group
index 83aefe6781edfd1fcd30ece4ccfa16244aefd181..d7add587d7e84a4ebc57c006a018dc9eb7f0d627 100644 (file)
@@ -130,6 +130,9 @@ What's new
 - Make sure that undo restores paragraph longest label width correctly
   (bug 8242).
 
+- Fix undo machinery confusion after checking in a document under version
+  control (bug 8342).
+
 - Do not forget the undo information when doing a Save As...
 
 - Replace current selection when pasting (bug 8027).