From 0e0d9fe07bc7977f8601a41282ee5e37b4ad32bf Mon Sep 17 00:00:00 2001 From: Doug Coleman Date: Tue, 9 Apr 2013 16:15:07 -0700 Subject: [PATCH] scite: Add support for Linux scite. --- basis/editors/scite/scite.factor | 20 ++++++++------------ basis/editors/scite/windows/authors.txt | 1 + basis/editors/scite/windows/platforms.txt | 1 + basis/editors/scite/windows/windows.factor | 18 ++++++++++++++++++ 4 files changed, 28 insertions(+), 12 deletions(-) create mode 100644 basis/editors/scite/windows/authors.txt create mode 100644 basis/editors/scite/windows/platforms.txt create mode 100644 basis/editors/scite/windows/windows.factor diff --git a/basis/editors/scite/scite.factor b/basis/editors/scite/scite.factor index efd06be091..68df8aef55 100644 --- a/basis/editors/scite/scite.factor +++ b/basis/editors/scite/scite.factor @@ -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 index 0000000000..7c1b2f2279 --- /dev/null +++ b/basis/editors/scite/windows/authors.txt @@ -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 index 0000000000..8e1a55995e --- /dev/null +++ b/basis/editors/scite/windows/platforms.txt @@ -0,0 +1 @@ +windows diff --git a/basis/editors/scite/windows/windows.factor b/basis/editors/scite/windows/windows.factor new file mode 100644 index 0000000000..96f47e86e0 --- /dev/null +++ b/basis/editors/scite/windows/windows.factor @@ -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* ; +