]> gitweb.factorcode.org Git - factor.git/commitdiff
editors.zed: support opening to file:line
authorJohn Benediktsson <mrjbq7@gmail.com>
Thu, 13 Jul 2023 23:04:36 +0000 (16:04 -0700)
committerJohn Benediktsson <mrjbq7@gmail.com>
Thu, 13 Jul 2023 23:04:36 +0000 (16:04 -0700)
basis/editors/zed/zed.factor

index 935e1c0591974a3e62105d986792e30f849f471e..789a3fcf80c53e0b53c10fe5dabec13eaa2f756c 100644 (file)
@@ -1,8 +1,15 @@
-USING: editors kernel make namespaces ;
+USING: editors io.pathnames io.standard-paths kernel make
+math.parser sequences ;
 IN: editors.zed
 
 SINGLETON: zed
 
+: find-zed-bundle-path ( -- path/f )
+    "dev.zed.Zed" find-native-bundle [
+        "Contents/MacOS/cli" append-path
+    ] [
+        f
+    ] if* ;
+
 M: zed editor-command
-    drop
-    [ "open" , "-a" , "Zed" , , ] { } make ;
+    [ find-zed-bundle-path , number>string ":" glue , ] { } make ;