class: SmallSense::SmalltalkQuickFixer cvs_MAIN
authorClaus Gittinger <cg@exept.de>
Thu, 03 Sep 2015 11:45:34 +0200
branchcvs_MAIN
changeset 876 43f96cd0eee1
parent 875 2e7c91b6773a
child 877 92bce2b53e1f
class: SmallSense::SmalltalkQuickFixer changed: #apply: use undoable interface; removed the need to add an extension to HTMLView
SmallSense__SmalltalkQuickFixer.st
--- a/SmallSense__SmalltalkQuickFixer.st	Tue Sep 01 18:58:19 2015 +0200
+++ b/SmallSense__SmalltalkQuickFixer.st	Thu Sep 03 11:45:34 2015 +0200
@@ -1,3 +1,5 @@
+"{ Encoding: utf8 }"
+
 "
 stx:goodies/smallsense - A productivity plugin for Smalltalk/X IDE
 Copyright (C) 2013-2014 Jan Vrany
@@ -128,13 +130,18 @@
         oldSource ~= newSource ifTrue: [
             | line |
 
-            line := view firstLineShown.
-            view contents: newSource asStringCollection clear: false.
-            view modified: true.
-            view isCodeView2 ifTrue: [
-                view reallyModifiedChannel value: true.
-            ].
-            view scrollToLine:line.     
+            view 
+                undoableDo:[
+                    line := view firstLineShown.
+                    view replaceContentsWith:newSource asStringCollection.
+"/                    view contents: newSource asStringCollection clear: false.
+                    view modified: true.
+                    view isCodeView2 ifTrue: [
+                        view reallyModifiedChannel value: true.
+                    ].
+                    view scrollToLine:line.     
+                ]
+                info:'Rewrite the code'.
         ].
     ] ifFalse: [
         | browser |