#FEATURE by stefan
authorStefan Vogel <sv@exept.de>
Fri, 27 Apr 2018 17:17:31 +0200
changeset 18067 1f116e0b51e3
parent 18066 daa0d7ed5690
child 18068 3f25904afb09
#FEATURE by stefan class: Tools::NavigationState changed: #setUpScrollableCodeView Support comparing of code via CodeView2::GutterView
Tools__NavigationState.st
--- a/Tools__NavigationState.st	Fri Apr 27 17:17:05 2018 +0200
+++ b/Tools__NavigationState.st	Fri Apr 27 17:17:31 2018 +0200
@@ -565,7 +565,7 @@
 !
 
 setUpScrollableCodeView
-    |v newScrollableCodeView newCodeView |
+    |wrapperView newScrollableCodeView newCodeView |
 
     (UserPreferences current useCodeView2In: #Browser) ifTrue:[
         newCodeView := newScrollableCodeView := CodeView2 new.
@@ -588,33 +588,35 @@
             languageHolder:self languageHolder
     ].
 
-    (UserPreferences current showAcceptCancelBarInBrowser 
-        and:[newCodeView isCodeView2 not or:[UserPreferences current codeView2ShowAcceptCancel not]]) ifTrue:[
-        ViewWithAcceptAndCancelBar notNil ifTrue:[
-            v := ViewWithAcceptAndCancelBar new.
-            v slaveView:newScrollableCodeView.
-            v reallyModifiedHolder:self realModifiedStateHolder.
-            v cancelAction:
-                [
+    UserPreferences current showAcceptCancelBarInBrowser ifTrue:[
+        (ViewWithAcceptAndCancelBar notNil 
+         and:[newCodeView isCodeView2 not 
+              or:[UserPreferences current codeView2ShowAcceptCancel not]]) ifTrue:[
+            wrapperView := ViewWithAcceptAndCancelBar new.
+            wrapperView slaveView:newScrollableCodeView.
+            wrapperView reallyModifiedHolder:self realModifiedStateHolder.
+            wrapperView cancelAction:[
                     "/ codeView setClipboardText:(codeView contents).   "/ for undo
                     newCodeView device rememberInCopyBufferHistory:(newCodeView contents).  "/ for undo
                     newCodeView application
                         delayedUpdateCodeWithAutoSearch:false checkModified:false.
                     newCodeView requestFocus.
                 ].
-            v compareAction:
-                [
+            newScrollableCodeView := wrapperView.
+        ].
+        (wrapperView notNil or:[newCodeView isCodeView2]) ifTrue:[
+            newScrollableCodeView compareAction:[
                     newCodeView application doCompareIn:self.
                     newCodeView requestFocus
                 ].
-            newScrollableCodeView := v.
-        ]
+        ].
     ].
 
    ^newScrollableCodeView
 
     "Modified: / 05-07-2011 / 10:34:33 / cg"
     "Modified: / 05-08-2011 / 09:44:52 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Modified (format): / 27-04-2018 / 17:10:29 / stefan"
 !
 
 specialEditorCanvasClassForResourceType:resourceTypeSymbol