]> gitweb.factorcode.org Git - factor.git/blob - basis/editors/ultraedit/ultraedit.factor
editors: allow them to be loaded in the load-all image
[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
7 editor-class [ ultraedit ] initialize
8
9 HOOK: find-ultraedit os ( -- path )
10
11 M: windows find-ultraedit
12     { "IDM Computer Solutions" } "uedit32.exe" find-in-applications
13     [ "uedit32.exe" ] unless* ;
14
15 M: macosx find-ultraedit
16     "com.idmcomp.uex" find-native-bundle [
17         "Contents/MacOS/UltraEdit" append-path
18     ] [
19         f
20     ] if* ;
21
22 : ultraedit-path ( -- path )
23     \ ultraedit-path get-global [ find-ultraedit ] unless* ;
24
25 M: ultraedit editor-command
26     [
27         ultraedit-path ,
28         os windows? [
29             [ swap % "/" % # "/1" % ] "" make
30         ] [ drop ] if ,
31     ] { } make ;