]> gitweb.factorcode.org Git - factor.git/commitdiff
editors.cudatext: support for CudaText editor.
authorJohn Benediktsson <mrjbq7@gmail.com>
Fri, 5 Aug 2022 23:12:03 +0000 (16:12 -0700)
committerJohn Benediktsson <mrjbq7@gmail.com>
Fri, 5 Aug 2022 23:12:03 +0000 (16:12 -0700)
basis/editors/cudatext/authors.txt [new file with mode: 0644]
basis/editors/cudatext/cudatext.factor [new file with mode: 0644]
basis/editors/cudatext/summary.txt [new file with mode: 0644]

diff --git a/basis/editors/cudatext/authors.txt b/basis/editors/cudatext/authors.txt
new file mode 100644 (file)
index 0000000..e091bb8
--- /dev/null
@@ -0,0 +1 @@
+John Benediktsson
diff --git a/basis/editors/cudatext/cudatext.factor b/basis/editors/cudatext/cudatext.factor
new file mode 100644 (file)
index 0000000..88d1dc8
--- /dev/null
@@ -0,0 +1,30 @@
+USING: editors io.pathnames io.standard-paths kernel make
+math.parser namespaces sequences system ;
+USING: editors ;
+
+IN: editors.cudatext
+
+SINGLETON: cudatext
+
+editor-class [ cudatext ] initialize
+
+HOOK: find-cudatext-path os ( -- path )
+
+M: object find-cudatext-path f ;
+
+M: macosx find-cudatext-path
+    "com.uvviewsoft.cudatext" find-native-bundle [
+        "Contents/MacOS/cudatext" append-path
+    ] [
+        f
+    ] if* ;
+
+: cudatext-path ( -- path )
+    \ cudatext-path get [
+        find-cudatext-path [ "cudatext" ?find-in-path ] unless*
+    ] unless* ;
+
+M: cudatext editor-command
+    [
+        cudatext-path , number>string ":" glue ,
+    ] { } make ;
diff --git a/basis/editors/cudatext/summary.txt b/basis/editors/cudatext/summary.txt
new file mode 100644 (file)
index 0000000..5a5aa13
--- /dev/null
@@ -0,0 +1 @@
+CudeText editor integration