factor/basis/editors/scite/scite.factor

32 lines
865 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
2008-12-15 22:45:18 -05:00
USING: io.files io.launcher kernel namespaces io.directories.search.windows
math math.parser editors sequences make unicode.case ;
2007-09-20 18:09:08 -04:00
IN: editors.scite
2008-01-29 12:41:12 -05:00
: scite-path ( -- path )
\ scite-path get-global [
"Scintilla Text Editor" t
[ >lower "scite.exe" tail? ] find-in-program-files
[
"SciTE Source Code Editor" t
[ >lower "scite.exe" tail? ] find-in-program-files
] unless*
[ "scite.exe" ] unless*
2008-01-29 12:41:12 -05:00
] unless* ;
2007-09-20 18:09:08 -04:00
: scite-command ( file line -- cmd )
swap
[
scite-path ,
,
number>string "-goto:" prepend ,
] { } make ;
2007-09-20 18:09:08 -04:00
: scite-location ( file line -- )
scite-command run-detached drop ;
2007-09-20 18:09:08 -04:00
[ scite-location ] edit-hook set-global