]> gitweb.factorcode.org Git - factor.git/blob - basis/editors/scite/scite.factor
49e1d74b07f022edf82dbd8999e30189abb7aeb3
[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: editors io.standard-paths kernel make math.parser
5 namespaces sequences system ;
6 IN: editors.scite
7
8 SINGLETON: scite
9 scite editor-class set-global
10
11 SYMBOL: scite-path
12
13 HOOK: find-scite-path os ( -- path )
14
15 M: unix find-scite-path "scite" ?find-in-path ;
16
17 M: windows find-scite-path
18     {
19         "Scintilla Text Editor"
20         "SciTE Source Code Editor"
21     } "scite.exe" find-in-applications
22     [ "scite.exe" ] unless* ;
23
24 M: scite editor-command ( file line -- cmd )
25     swap
26     [
27         scite-path get [ find-scite-path ] unless* ,
28         ,
29         number>string "-goto:" prepend ,
30     ] { } make ;