]> gitweb.factorcode.org Git - factor.git/commitdiff
editors.kate: adding Kate editor integration
authorJohn Benediktsson <mrjbq7@gmail.com>
Sun, 7 Aug 2022 15:02:42 +0000 (08:02 -0700)
committerJohn Benediktsson <mrjbq7@gmail.com>
Sun, 7 Aug 2022 15:02:42 +0000 (08:02 -0700)
basis/editors/kate/authors.txt [new file with mode: 0644]
basis/editors/kate/kate.factor [new file with mode: 0644]
basis/editors/kate/summary.txt [new file with mode: 0644]

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