AbstractFileBrowser.st
changeset 18775 24687514152a
parent 18774 2551a3ae4dd7
child 18805 f6df57c6dbfb
--- a/AbstractFileBrowser.st	Sun May 26 02:37:42 2019 +0200
+++ b/AbstractFileBrowser.st	Sun May 26 02:59:36 2019 +0200
@@ -1,3 +1,5 @@
+"{ Encoding: utf8 }"
+
 "
  COPYRIGHT (c) 2002 by eXept Software AG
               All Rights Reserved
@@ -3034,7 +3036,7 @@
                                     "/ are perfect here, but usually not available in the font
                                     "/ and we have currently no way of knowing if they are...
                                     "/ (could let the font draw into a bitmap and check if there is something...)
-                                    "/ For now, write a dot.·
+                                    "/ For now, write a dot.·
                                     "/ charPrinted := (Character value:(byte + 16r2400))
                                 ].
                             ].
@@ -8244,10 +8246,13 @@
     "open a change browser on the selected file(s)"
 
     |files remaining|
-    
+
+    files := self currentSelectedFiles.
+    remaining := files copy.
+
+    "/ special for github-downloaded package&class folders (one method per file)
+    "/ these are named .package and .class
     GitHubSmalltalkPackageReader notNil ifTrue:[
-        files := self currentSelectedFiles.
-        remaining := files copy.
         files do:[:fn |
             fn isDirectory ifTrue:[
                 (fn suffix = 'package') ifTrue:[
@@ -8264,9 +8269,26 @@
         remaining isEmpty ifTrue:[^ self].
     ].
     
+    "/ special for new github-downloaded source files
+    "/ these are named *.class.st, *.extension.st and *.trait.st
+    remaining copy do:[:fn |
+        #( '.class' '.extension' '.trait') contains:[:suff |
+            |changeSet|
+            
+            (fn withoutSuffix baseName endsWith:suff) ifTrue:[
+                fn readingFileDo:[:in |
+                    changeSet := ChangeSet fromGithubPharoSmalltalkStream:in.
+                ].    
+                ChangeSetBrowser openOn:changeSet.
+                remaining remove:fn.
+            ].    
+        ].    
+        remaining isEmpty ifTrue:[^ self].
+    ].
+    
     self openTool:(UserPreferences current changesBrowserClass)
 
-    "Modified: / 26-05-2019 / 02:37:03 / Claus Gittinger"
+    "Modified: / 26-05-2019 / 02:58:27 / Claus Gittinger"
 !
 
 openDiffView
@@ -8866,7 +8888,7 @@
             ] ifFalse:[sig == HaltInterrupt ifTrue:[ |sender|
                 label := msg := 'Breakpoint/Halt in fileIn'.
                 sender := ex suspendedContext.
-                msg := msg , ('\\in %1 » %2' bindWith:(sender receiver class name) with:(sender sender selector))
+                msg := msg , ('\\in %1 » %2' bindWith:(sender receiver class name) with:(sender sender selector))
             ] ifFalse:[
                 label := 'Error in fileIn'.
                 msg := 'error in fileIn: %1'