]> gitweb.factorcode.org Git - factor.git/commitdiff
scite: Add support for Linux scite.
authorDoug Coleman <doug.coleman@gmail.com>
Tue, 9 Apr 2013 23:15:07 +0000 (16:15 -0700)
committerDoug Coleman <doug.coleman@gmail.com>
Tue, 9 Apr 2013 23:15:47 +0000 (16:15 -0700)
basis/editors/scite/scite.factor
basis/editors/scite/windows/authors.txt [new file with mode: 0644]
basis/editors/scite/windows/platforms.txt [new file with mode: 0644]
basis/editors/scite/windows/windows.factor [new file with mode: 0644]

index efd06be0913b6d0d92b1fe9e9f8d63bf75a40b5c..68df8aef559854212e1c7611d3a046ce6f6c1bc5 100644 (file)
@@ -1,24 +1,18 @@
 ! Copyright (C) 2007 Clemens F. Hofreither.
 ! See http://factorcode.org/license.txt for BSD license.
 ! clemens.hofreither@gmx.net
-USING: io.files io.launcher kernel namespaces io.directories.search.windows
-math math.parser editors sequences make unicode.case ;
+USING: io.files io.launcher kernel namespaces
+math math.parser editors sequences make system unicode.case
+vocabs ;
 IN: editors.scite
 
 SINGLETON: scite
 scite editor-class set-global
 
-: scite-path ( -- path )
-    \ scite-path get-global [
-        "Scintilla Text Editor"
-        [ >lower "scite.exe" tail? ] find-in-program-files
+HOOK: scite-path os ( -- path )
 
-        [
-            "SciTE Source Code Editor"
-            [ >lower "scite.exe" tail? ] find-in-program-files
-        ] unless*
-        [ "scite.exe" ] unless*
-    ] unless* ;
+M: unix scite-path ( -- path )
+    \ scite-path get-global [ "scite" ] unless* ;
 
 M: scite editor-command ( file line -- cmd )
     swap
@@ -27,3 +21,5 @@ M: scite editor-command ( file line -- cmd )
         ,
         number>string "-goto:" prepend ,
     ] { } make ;
+
+os windows? [ "editors.scite.windows" require ] when
diff --git a/basis/editors/scite/windows/authors.txt b/basis/editors/scite/windows/authors.txt
new file mode 100644 (file)
index 0000000..7c1b2f2
--- /dev/null
@@ -0,0 +1 @@
+Doug Coleman
diff --git a/basis/editors/scite/windows/platforms.txt b/basis/editors/scite/windows/platforms.txt
new file mode 100644 (file)
index 0000000..8e1a559
--- /dev/null
@@ -0,0 +1 @@
+windows
diff --git a/basis/editors/scite/windows/windows.factor b/basis/editors/scite/windows/windows.factor
new file mode 100644 (file)
index 0000000..96f47e8
--- /dev/null
@@ -0,0 +1,18 @@
+! Copyright (C) 2013 Doug Coleman.
+! See http://factorcode.org/license.txt for BSD license.
+USING: io.files io.launcher kernel namespaces io.directories.search.windows
+math math.parser editors sequences system unicode.case ;
+IN: editors.scite.windows
+
+M: windows scite-path ( -- path )
+    \ scite-path get-global [
+        "Scintilla Text Editor"
+        [ >lower "scite.exe" tail? ] find-in-program-files
+
+        [
+            "SciTE Source Code Editor"
+            [ >lower "scite.exe" tail? ] find-in-program-files
+        ] unless*
+        [ "scite.exe" ] unless*
+    ] unless* ;
+