factor/basis/editors/scite/scite.factor

31 lines
742 B
Factor
Raw Normal View History

! Copyright (C) 2007 Clemens F. Hofreither.
! See http://factorcode.org/license.txt for BSD license.
2007-09-20 18:09:08 -04:00
! clemens.hofreither@gmx.net
2015-06-01 17:39:30 -04:00
USING: editors io.standard-paths kernel make math.parser
namespaces sequences system ;
2007-09-20 18:09:08 -04:00
IN: editors.scite
SINGLETON: scite
scite editor-class set-global
2015-06-01 17:39:30 -04:00
SYMBOL: scite-path
2015-06-01 17:39:30 -04:00
HOOK: find-scite-path os ( -- path )
M: unix find-scite-path "scite" ?find-in-path ;
M: windows find-scite-path
{
"Scintilla Text Editor"
"SciTE Source Code Editor"
} "scite.exe" find-in-applications
[ "scite.exe" ] unless* ;
2007-09-20 18:09:08 -04:00
M: scite editor-command ( file line -- cmd )
swap
[
2015-06-01 17:39:30 -04:00
scite-path get [ find-scite-path ] unless* ,
,
number>string "-goto:" prepend ,
] { } make ;