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
9 sublime editor-class set-global
11 HOOK: find-sublime-path os ( -- path )
13 M: object find-sublime-path f ;
15 M: macosx find-sublime-path
16 { "com.sublimetext.3" "com.sublimetext.2" } [ find-native-bundle ] map-find drop [
17 "Contents/SharedSupport/bin/subl" append-path
22 M: windows find-sublime-path
24 [ { "Sublime Text 3" } "subl.exe" find-in-applications ]
25 [ { "Sublime Text 2" } "sublime_text.exe" find-in-applications ]
29 : sublime-path ( -- path )
31 find-sublime-path [ "subl" ?find-in-path ] unless*
34 M: sublime editor-command ( file line -- command )
36 sublime-path , "-a" , number>string ":" glue ,