]> gitweb.factorcode.org Git - factor.git/blob - basis/editors/atom/atom.factor
editors: allow them to be loaded in the load-all image
[factor.git] / basis / editors / atom / atom.factor
1 ! Copyright (C) 2014 Doug Coleman.
2 ! See http://factorcode.org/license.txt for BSD license.
3 USING: editors io.pathnames io.standard-paths kernel make
4 math.parser namespaces sequences system ;
5 IN: editors.atom
6
7 SINGLETON: atom
8
9 editor-class [ atom ] initialize
10
11 SYMBOL: atom-path
12
13 HOOK: find-atom os ( -- path )
14
15 M: object find-atom
16     "atom" ?find-in-path ;
17
18 M: macosx find-atom
19     "com.github.Atom" find-native-bundle [
20         "Contents/MacOS/Atom" append-path
21     ] [
22         f
23     ] if* ;
24
25 M: atom editor-command
26     [
27         atom-path get [ find-atom ] unless* ,
28         number>string ":" glue ,
29     ] { } make ;