]> gitweb.factorcode.org Git - factor.git/blob - basis/editors/10x/10x.factor
a2495ee242547cc4b30145807dbe02a3617d701e
[factor.git] / basis / editors / 10x / 10x.factor
1 ! Copyright (C) 2023 Doug Coleman.
2 ! See http://factorcode.org/license.txt for BSD license.
3 USING: editors io.standard-paths kernel make math math.parser
4 namespaces sequences system ;
5 IN: editors.10x
6
7 SINGLETON: 10x-editor
8
9 editor-class [ 10x-editor ] initialize
10
11 SYMBOL: 10x-editor-path
12
13 HOOK: find-10x-editor-path os ( -- path )
14
15 M: unix find-10x-editor-path "10x" ?find-in-path ;
16
17 M: windows find-10x-editor-path
18     { "PureDevSoftware/10x" } "10x.exe" find-in-applications
19     [ "10x.exe" ] unless* ;
20
21 M: 10x-editor editor-command
22     [
23         10x-editor-path get [ find-10x-editor-path ] unless* ,
24         [ , ]
25         ! python command SetCursorPos
26         [ 1 - number>string "N10X.Editor.SetCursorPos((0," "))" surround , ] bi*
27     ] { } make ;