DebugView.st
changeset 18066 daa0d7ed5690
parent 18060 0cdd2d55d5b0
child 18097 3defacfa15f0
--- a/DebugView.st	Fri Apr 27 17:15:40 2018 +0200
+++ b/DebugView.st	Fri Apr 27 17:17:05 2018 +0200
@@ -1,5 +1,3 @@
-"{ Encoding: utf8 }"
-
 "
  COPYRIGHT (c) 1989 by Claus Gittinger
               All Rights Reserved
@@ -3486,14 +3484,15 @@
         codeView enableMotionEvents. "/ for active help
     ].
 
-     (UserPreferences current showAcceptCancelBarInBrowser
-        and:[codeView isCodeView2 not or:[UserPreferences current codeView2ShowAcceptCancel not]]) ifTrue:[
-        ViewWithAcceptAndCancelBar notNil ifTrue:[
-            |v|
-
-            v := ViewWithAcceptAndCancelBar new.
-            v slaveView:scrollableCodeView.
-            v reallyModifiedHolder:(codeView isCodeView2
+    UserPreferences current showAcceptCancelBarInBrowser ifTrue:[
+        |wrapperView|
+
+        (ViewWithAcceptAndCancelBar notNil 
+         and:[codeView isCodeView2 not 
+              or:[UserPreferences current codeView2ShowAcceptCancel not]]) ifTrue:[
+            wrapperView := ViewWithAcceptAndCancelBar new.
+            wrapperView slaveView:scrollableCodeView.
+            wrapperView reallyModifiedHolder:(codeView isCodeView2
                                         ifTrue:[ codeView reallyModifiedChannel ]
                                         ifFalse:[
                                             BlockValue
@@ -3506,7 +3505,7 @@
                                                 ]
                                                 argument:codeView modifiedChannel
                                         ]).
-            v cancelAction:
+            wrapperView cancelAction:
                 [
                     "/ codeView setClipboardText:(codeView contents).   "/ for undo
                     codeView device rememberInCopyBufferHistory:(codeView contents).  "/ for undo
@@ -3514,25 +3513,29 @@
                     codeView modifiedChannel setValue:false; changed.   "/ trigger
                     codeView requestFocus.
                 ].
-            v compareAction:
-                [
-                    v := DiffCodeView
+            scrollableCodeView := wrapperView.
+        ].
+        (wrapperView notNil or:[codeView isCodeView2]) ifTrue:[
+            scrollableCodeView compareAction:[
+                    |diffView|
+
+                    diffView := DiffCodeView
                             openOn:codeView contentsAsString
                             label:(resources string:'Changed definition (to be accepted ?)')
                             and:currentMethod source
                             label:(resources string:'Method''s Original Code').
-                    v label:(resources string:'Changed Code in Debugger').
-                    v waitUntilVisible.
+                    diffView label:(resources string:'Changed Code in Debugger').
+                    diffView waitUntilVisible.
                     "/ codeView requestFocus
                 ].
-            scrollableCodeView := v.
-        ]
+        ].
     ].
 
     panel add:scrollableCodeView.
     ^ scrollableCodeView
 
     "Modified: / 06-12-2013 / 17:30:55 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Modified: / 27-04-2018 / 17:09:39 / stefan"
 !
 
 initializeContextListViewIn:panel
@@ -7693,7 +7696,7 @@
                 ]
             ].
 
-            s := Text streamContents:[:s | aContext printWithSeparator:' » ' on:s ].
+            s := Text streamContents:[:s | aContext printWithSeparator:' » ' on:s ].
             RememberedCallChain notNil ifTrue:[
                 (RememberedCallChain includesIdentical:aContext) ifTrue:[
                     s := s withColor:#red.
@@ -9788,7 +9791,7 @@
 
 printConditionOn:aStream
     ignoredSendingClassAndSelectors notEmptyOrNil ifTrue:[
-        aStream nextPutAll:(' if called from %1 » %2'
+        aStream nextPutAll:(' if called from %1 » %2'
                                 bindWith:ignoredSendingClassAndSelectors first first
                                 with:ignoredSendingClassAndSelectors first second).
         ^ self.