]> gitweb.factorcode.org Git - factor.git/blob - basis/editors/scite/scite.factor
Merge branch 'master' into experimental
[factor.git] / basis / editors / scite / scite.factor
1 ! Copyright (C) 2007 Clemens F. Hofreither.
2 ! See http://factorcode.org/license.txt for BSD license.
3 ! clemens.hofreither@gmx.net
4 USING: io.files io.launcher kernel namespaces io.directories.search.windows
5 math math.parser editors sequences make unicode.case ;
6 IN: editors.scite
7
8 : scite-path ( -- path )
9     \ scite-path get-global [
10         "Scintilla Text Editor" t
11         [ >lower "scite.exe" tail? ] find-in-program-files
12
13         [
14             "SciTE Source Code Editor" t
15             [ >lower "scite.exe" tail? ] find-in-program-files
16         ] unless*
17         [ "scite.exe" ] unless*
18     ] unless* ;
19
20 : scite-command ( file line -- cmd )
21     swap
22     [
23         scite-path ,
24         ,
25         number>string "-goto:" prepend ,
26     ] { } make ;
27
28 : scite-location ( file line -- )
29     scite-command run-detached drop ;
30
31 [ scite-location ] edit-hook set-global