2010-09-15 00:20:02 -04:00
|
|
|
! Copyright (C) 2004, 2010 Slava Pestov.
|
2007-09-20 18:09:08 -04:00
|
|
|
! See http://factorcode.org/license.txt for BSD license.
|
2011-10-31 14:53:07 -04:00
|
|
|
USING: combinators.short-circuit editors io.pathnames
|
|
|
|
io.standard-paths kernel make math.parser namespaces sequences
|
|
|
|
system ;
|
2007-09-20 18:09:08 -04:00
|
|
|
IN: editors.jedit
|
|
|
|
|
2011-10-31 14:53:07 -04:00
|
|
|
SINGLETON: jedit
|
|
|
|
jedit editor-class set-global
|
2010-09-15 00:20:02 -04:00
|
|
|
|
2011-10-31 14:53:07 -04:00
|
|
|
HOOK: find-jedit-path os ( -- path )
|
2007-09-20 18:09:08 -04:00
|
|
|
|
2015-06-01 17:39:30 -04:00
|
|
|
M: object find-jedit-path f ;
|
2007-09-20 18:09:08 -04:00
|
|
|
|
2011-10-31 14:53:07 -04:00
|
|
|
M: macosx find-jedit-path
|
2015-06-01 17:39:30 -04:00
|
|
|
"org.gjt.sp.jedit" find-native-bundle [
|
|
|
|
"Contents/MacOS/jedit" append-path
|
|
|
|
] [
|
|
|
|
f
|
|
|
|
] if* ;
|
2007-09-20 18:09:08 -04:00
|
|
|
|
2011-10-31 14:53:07 -04:00
|
|
|
M: windows find-jedit-path
|
|
|
|
{ "jedit" } "jedit.exe" find-in-applications ;
|
2015-06-01 17:39:30 -04:00
|
|
|
|
2011-10-31 14:53:07 -04:00
|
|
|
: jedit-path ( -- path )
|
2015-06-01 17:39:30 -04:00
|
|
|
\ jedit-path get [
|
|
|
|
find-jedit-path [ "jedit" ?find-in-path ] unless*
|
2011-10-31 14:53:07 -04:00
|
|
|
] unless* ;
|
2007-09-20 18:09:08 -04:00
|
|
|
|
2011-10-31 14:53:07 -04:00
|
|
|
M: jedit editor-command ( file line -- command/f )
|
|
|
|
[
|
|
|
|
find-jedit-path ,
|
2011-11-02 19:47:10 -04:00
|
|
|
"-reuseview" ,
|
2011-10-31 14:53:07 -04:00
|
|
|
[ , ] [ number>string "+line:" prepend , ] bi*
|
|
|
|
] { } make ;
|