[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    [kate] part/script: balance the edit stack in any case
From:       Christoph Cullmann <cullmann () kde ! org>
Date:       2012-10-31 23:22:06
Message-ID: 20121031232206.5FBA8A6078 () git ! kde ! org
[Download RAW message or body]

Git commit 58728236f9353415ffe8324aca9b2c17b8ef6dda by Christoph Cullmann.
Committed on 01/11/2012 at 00:22.
Pushed by cullmann into branch 'master'.

balance the edit stack in any case

M  +5    -1    part/script/katecommandlinescript.cpp

http://commits.kde.org/kate/58728236f9353415ffe8324aca9b2c17b8ef6dda

diff --git a/part/script/katecommandlinescript.cpp b/part/script/katecommandlinescript.cpp
index d11569f..93e7847 100644
--- a/part/script/katecommandlinescript.cpp
+++ b/part/script/katecommandlinescript.cpp
@@ -129,7 +129,11 @@ bool KateCommandLineScript::exec(KTextEditor::View *view, const QString &cmd, QS
 
   if (setView(qobject_cast<KateView*>(view))) {
     // setView fails if the script cannot be loaded
-    return callFunction(_cmd, args, msg);
+    // balance edit stack in any case!
+    qobject_cast<KateView*>(view)->doc()->pushEditState();
+    bool success = callFunction(_cmd, args, msg);
+    qobject_cast<KateView*>(view)->doc()->popEditState();
+    return success;
   }
 
   return false;
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic