1 ! Copyright (C) 2013 Doug Coleman.
2 ! See http://factorcode.org/license.txt for BSD license.
3 USING: combinators.short-circuit editors io.pathnames
4 io.standard-paths kernel make math.parser namespaces sequences
10 editor-class [ sublime ] initialize
12 HOOK: find-sublime-path os ( -- path )
14 M: object find-sublime-path f ;
16 M: macosx find-sublime-path
17 { "com.sublimetext.3" "com.sublimetext.2" } [ find-native-bundle ] map-find drop [
18 "Contents/SharedSupport/bin/subl" append-path
23 M: windows find-sublime-path
25 [ { "Sublime Text 3" } "subl.exe" find-in-applications ]
26 [ { "Sublime Text 2" } "sublime_text.exe" find-in-applications ]
30 : sublime-path ( -- path )
32 find-sublime-path [ "subl" ?find-in-path ] unless*
35 M: sublime editor-command
37 sublime-path , "-a" , number>string ":" glue ,