]> gitweb.factorcode.org Git - factor.git/blob - basis/editors/ultraedit/ultraedit.factor
539123aad5d3f6bfc4470c263589da6bc5cc51eb
[factor.git] / basis / editors / ultraedit / ultraedit.factor
1 USING: editors io.pathnames io.standard-paths kernel make
2 math.parser namespaces system ;
3 IN: editors.ultraedit
4
5 SINGLETON: ultraedit
6 ultraedit editor-class set-global
7
8 HOOK: find-ultraedit os ( -- path )
9
10 M: windows find-ultraedit
11     { "IDM Computer Solutions" } "uedit32.exe" find-in-applications
12     [ "uedit32.exe" ] unless* ;
13
14 M: macosx find-ultraedit
15     "com.idmcomp.uex" find-native-bundle [
16         "Contents/MacOS/UltraEdit" append-path
17     ] [
18         f
19     ] if* ;
20
21 : ultraedit-path ( -- path )
22     \ ultraedit-path get-global [ find-ultraedit ] unless* ;
23
24 M: ultraedit editor-command
25     [
26         ultraedit-path ,
27         os windows? [
28             [ swap % "/" % # "/1" % ] "" make
29         ] [ drop ] if ,
30     ] { } make ;