]> gitweb.factorcode.org Git - factor.git/commitdiff
editors.pulsar: adding Pulsar text editor support
authorJohn Benediktsson <mrjbq7@gmail.com>
Fri, 17 Feb 2023 20:37:42 +0000 (12:37 -0800)
committerJohn Benediktsson <mrjbq7@gmail.com>
Fri, 17 Feb 2023 20:37:42 +0000 (12:37 -0800)
basis/editors/pulsar/authors.txt [new file with mode: 0644]
basis/editors/pulsar/pulsar.factor [new file with mode: 0644]
basis/editors/pulsar/summary.txt [new file with mode: 0644]

diff --git a/basis/editors/pulsar/authors.txt b/basis/editors/pulsar/authors.txt
new file mode 100644 (file)
index 0000000..e091bb8
--- /dev/null
@@ -0,0 +1 @@
+John Benediktsson
diff --git a/basis/editors/pulsar/pulsar.factor b/basis/editors/pulsar/pulsar.factor
new file mode 100644 (file)
index 0000000..81fb80f
--- /dev/null
@@ -0,0 +1,27 @@
+! Copyright (C) 2023 John Benediktsson
+! See https://factorcode.org/license.txt for BSD license.
+USING: editors io.pathnames io.standard-paths kernel make
+math.parser namespaces sequences system ;
+IN: editors.pulsar
+
+SINGLETON: pulsar
+
+SYMBOL: pulsar-path
+
+HOOK: find-pulsar os ( -- path )
+
+M: object find-pulsar
+    "pulsar" ?find-in-path ;
+
+M: macosx find-pulsar
+    "dev.pulsar-edit.pulsar" find-native-bundle [
+        "Contents/MacOS/Pulsar" append-path
+    ] [
+        f
+    ] if* ;
+
+M: pulsar editor-command
+    [
+        pulsar-path get [ find-pulsar ] unless* ,
+        number>string ":" glue ,
+    ] { } make ;
diff --git a/basis/editors/pulsar/summary.txt b/basis/editors/pulsar/summary.txt
new file mode 100644 (file)
index 0000000..89fea97
--- /dev/null
@@ -0,0 +1 @@
+Pulsar editor integration