]> gitweb.factorcode.org Git - factor.git/commitdiff
editors.lapce: adding Lapce editor integration
authorJohn Benediktsson <mrjbq7@gmail.com>
Tue, 6 Dec 2022 18:35:04 +0000 (10:35 -0800)
committerJohn Benediktsson <mrjbq7@gmail.com>
Tue, 6 Dec 2022 18:35:18 +0000 (10:35 -0800)
basis/editors/lapce/authors.txt [new file with mode: 0644]
basis/editors/lapce/lapce.factor [new file with mode: 0644]
basis/editors/lapce/summary.txt [new file with mode: 0644]

diff --git a/basis/editors/lapce/authors.txt b/basis/editors/lapce/authors.txt
new file mode 100644 (file)
index 0000000..e091bb8
--- /dev/null
@@ -0,0 +1 @@
+John Benediktsson
diff --git a/basis/editors/lapce/lapce.factor b/basis/editors/lapce/lapce.factor
new file mode 100644 (file)
index 0000000..6777e7b
--- /dev/null
@@ -0,0 +1,27 @@
+USING: editors io.pathnames io.standard-paths kernel make
+math.parser namespaces sequences system ;
+
+IN: editors.lapce
+
+SINGLETON: lapce
+
+editor-class [ lapce ] initialize
+
+HOOK: find-lapce-path os ( -- path )
+
+M: object find-lapce-path f ;
+
+M: macosx find-lapce-path
+    "io.lapce" find-native-bundle [
+        "Contents/MacOS/lapce" append-path
+    ] [
+        f
+    ] if* ;
+
+: lapce-path ( -- path )
+    \ lapce-path get [
+        find-lapce-path [ "lapce" ?find-in-path ] unless*
+    ] unless* ;
+
+M: lapce editor-command
+    [ lapce-path , drop , ] { } make ;
diff --git a/basis/editors/lapce/summary.txt b/basis/editors/lapce/summary.txt
new file mode 100644 (file)
index 0000000..bf4c1ac
--- /dev/null
@@ -0,0 +1 @@
+Lapce editor integration