changeset 27127:8854d65e3bcc stable

undo a complete replace all action in the editor (bug #56405) * find-dialog.cc (replace_all): add begin and end undo action calls around the loop with all replace actions
author Torsten Lilge <ttl-octave@mailbox.org>
date Thu, 30 May 2019 11:35:51 +0200
parents 5af449d4e1f4
children acedcba362be 8a07083c8cfc
files libgui/src/m-editor/find-dialog.cc
diffstat 1 files changed, 3 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/libgui/src/m-editor/find-dialog.cc	Mon May 27 15:47:21 2019 -0700
+++ b/libgui/src/m-editor/find-dialog.cc	Thu May 30 11:35:51 2019 +0200
@@ -414,12 +414,15 @@
 
         _rep_all = 1;
         find_next ();  // find first occurence (forward)
+
+        _edit_area->beginUndoAction ();
         while (_find_result_available)   // while search string is found
           {
             do_replace ();
             _rep_all++;                                          // inc counter
             find_next ();                                        // find next
           }
+        _edit_area->endUndoAction ();
 
         QMessageBox msg_box (QMessageBox::Information, tr ("Replace Result"),
                              tr ("%1 items replaced").arg (_rep_all-1),