factor/basis/editors/scite/scite.factor

32 lines
738 B
Factor
Raw Normal View History

2007-09-20 18:09:08 -04:00
! Basic SciTE integration for Factor.
!
! By Clemens F. Hofreither, 2007.
! clemens.hofreither@gmx.net
!
! In your .factor-rc or .factor-boot-rc,
! require this module and set the scite-path
! variable to point to your executable,
! if not on the path.
!
2008-01-29 12:41:12 -05:00
USING: io.files io.launcher kernel namespaces math
math.parser editors sequences windows.shell32 ;
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 [
program-files "wscite\\SciTE.exe" append-path
2008-01-29 12:41:12 -05:00
] unless* ;
2007-09-20 18:09:08 -04:00
: scite-command ( file line -- cmd )
swap
2008-01-24 02:50:40 -05:00
[
2008-01-29 12:41:12 -05:00
scite-path ,
2008-01-24 02:50:40 -05:00
,
"-goto:" swap number>string append ,
] { } make ;
2007-09-20 18:09:08 -04:00
: scite-location ( file line -- )
2008-01-24 02:50:40 -05:00
scite-command run-detached drop ;
2007-09-20 18:09:08 -04:00
[ scite-location ] edit-hook set-global