]> gitweb.factorcode.org Git - factor.git/blob - basis/editors/cudatext/cudatext.factor
editors.cudatext: support for CudaText editor.
[factor.git] / basis / editors / cudatext / cudatext.factor
1 USING: editors io.pathnames io.standard-paths kernel make
2 math.parser namespaces sequences system ;
3 USING: editors ;
4
5 IN: editors.cudatext
6
7 SINGLETON: cudatext
8
9 editor-class [ cudatext ] initialize
10
11 HOOK: find-cudatext-path os ( -- path )
12
13 M: object find-cudatext-path f ;
14
15 M: macosx find-cudatext-path
16     "com.uvviewsoft.cudatext" find-native-bundle [
17         "Contents/MacOS/cudatext" append-path
18     ] [
19         f
20     ] if* ;
21
22 : cudatext-path ( -- path )
23     \ cudatext-path get [
24         find-cudatext-path [ "cudatext" ?find-in-path ] unless*
25     ] unless* ;
26
27 M: cudatext editor-command
28     [
29         cudatext-path , number>string ":" glue ,
30     ] { } make ;