editors.sublime: Add support for Sublime Editor 2 for MacOSX. Need to add support for Windows.
parent
0e425e70d0
commit
b129623080
|
@ -0,0 +1 @@
|
|||
Doug Coleman
|
|
@ -0,0 +1,31 @@
|
|||
! Copyright (C) 2013 Doug Coleman.
|
||||
! See http://factorcode.org/license.txt for BSD license.
|
||||
USING: editors io.pathnames io.standard-paths kernel make
|
||||
math.parser namespaces sequences system ;
|
||||
IN: editors.sublime
|
||||
|
||||
SINGLETON: sublime
|
||||
sublime editor-class set-global
|
||||
|
||||
HOOK: find-sublime-path os ( -- path )
|
||||
|
||||
M: object find-sublime-path "sublime" ;
|
||||
|
||||
M: macosx find-sublime-path
|
||||
"com.sublimetext.2" find-native-bundle [
|
||||
"Contents/SharedSupport/bin/subl" append-path
|
||||
] [
|
||||
f
|
||||
] if* ;
|
||||
|
||||
ERROR: editor-not-found editor ;
|
||||
|
||||
: sublime-path ( -- path )
|
||||
\ sublime-path get-global [
|
||||
find-sublime-path [ "sublime" editor-not-found ] unless*
|
||||
] unless* ;
|
||||
|
||||
M: sublime editor-command ( file line -- command )
|
||||
[
|
||||
sublime-path , "-a" , number>string ":" glue ,
|
||||
] { } make ;
|
Loading…
Reference in New Issue