]> gitweb.factorcode.org Git - factor.git/commitdiff
editors.10x: Add 10x editor
authorDoug Coleman <doug.coleman@gmail.com>
Thu, 5 Jan 2023 18:19:20 +0000 (12:19 -0600)
committerDoug Coleman <doug.coleman@gmail.com>
Thu, 5 Jan 2023 18:19:20 +0000 (12:19 -0600)
Opening to file/line uses a python command from the command-line.

https://10xeditor.com/

basis/editors/10x/10x.factor [new file with mode: 0644]
basis/editors/10x/authors.txt [new file with mode: 0644]

diff --git a/basis/editors/10x/10x.factor b/basis/editors/10x/10x.factor
new file mode 100644 (file)
index 0000000..42fbf4e
--- /dev/null
@@ -0,0 +1,29 @@
+! Copyright (C) 2023 Doug Coleman.
+! See http://factorcode.org/license.txt for BSD license.
+USING: editors io.standard-paths kernel make math math.parser
+namespaces sequences system ;
+IN: editors.10x
+
+SINGLETON: 10x-editor
+
+editor-class [ 10x-editor ] initialize
+
+SYMBOL: 10x-editor-path
+
+HOOK: find-10x-editor-path os ( -- path )
+
+M: unix find-10x-editor-path "10x" ?find-in-path ;
+
+M: windows find-10x-editor-path
+    {
+        "PureDevSoftware/10x"
+    } "10x.exe" find-in-applications
+    [ "10x.exe" ] unless* ;
+
+M: 10x-editor editor-command
+    [
+        10x-editor-path get [ find-10x-editor-path ] unless* ,
+        [ , ]
+        ! python command SetCursorPos
+        [ 1 - number>string "N10X.Editor.SetCursorPos((0," "))" surround , ] bi*
+    ] { } make ;
diff --git a/basis/editors/10x/authors.txt b/basis/editors/10x/authors.txt
new file mode 100644 (file)
index 0000000..7c1b2f2
--- /dev/null
@@ -0,0 +1 @@
+Doug Coleman