]> gitweb.factorcode.org Git - factor.git/commitdiff
editors.ultraedit: support ultraedit on the mac.
authorJohn Benediktsson <mrjbq7@gmail.com>
Fri, 19 Mar 2021 18:03:11 +0000 (11:03 -0700)
committerJohn Benediktsson <mrjbq7@gmail.com>
Fri, 19 Mar 2021 18:15:22 +0000 (11:15 -0700)
basis/editors/ultraedit/ultraedit.factor

index 10bee459093790b267de407cad0130ebae32a5a5..539123aad5d3f6bfc4470c263589da6bc5cc51eb 100644 (file)
@@ -1,17 +1,30 @@
-USING: editors io.standard-paths kernel make math.parser
-namespaces ;
+USING: editors io.pathnames io.standard-paths kernel make
+math.parser namespaces system ;
 IN: editors.ultraedit
 
 SINGLETON: ultraedit
 ultraedit editor-class set-global
 
+HOOK: find-ultraedit os ( -- path )
+
+M: windows find-ultraedit
+    { "IDM Computer Solutions" } "uedit32.exe" find-in-applications
+    [ "uedit32.exe" ] unless* ;
+
+M: macosx find-ultraedit
+    "com.idmcomp.uex" find-native-bundle [
+        "Contents/MacOS/UltraEdit" append-path
+    ] [
+        f
+    ] if* ;
+
 : ultraedit-path ( -- path )
-    \ ultraedit-path get-global [
-        { "IDM Computer Solutions" } "uedit32.exe" find-in-applications
-        [ "uedit32.exe" ] unless*
-    ] unless* ;
+    \ ultraedit-path get-global [ find-ultraedit ] unless* ;
 
 M: ultraedit editor-command
     [
-        ultraedit-path , [ swap % "/" % # "/1" % ] "" make ,
+        ultraedit-path ,
+        os windows? [
+            [ swap % "/" % # "/1" % ] "" make
+        ] [ drop ] if ,
     ] { } make ;