<commit_before>! Copyright (C) 2004, 2010 <NAME>.
! See http://factorcode.org/license.txt for BSD license.
USING: combinators.short-circuit editors io.pathnames
io.standard-paths kernel make math.parser namespaces sequences
system ;
IN: editors.jedit

SINGLETON: jedit
jedit editor-class set-global

ERROR: jedit-not-found ;

HOOK: find-jedit-path os ( -- path )

M: object find-jedit-path f ;

M: macosx find-jedit-path
    "org.gjt.sp.jedit" find-native-bundle
    dup [ "Contents/MacOS/jedit" append-path ] when ;

M: windows find-jedit-path
    { "jedit" } "jedit.exe" find-in-applications ;
    
: jedit-path ( -- path )
    \ jedit-path get-global [
        find-jedit-path "jedit" or
    ] unless* ;

M: jedit editor-command ( file line -- command/f )
    [
        find-jedit-path ,
        "-reuseview" ,
        [ , ] [ number>string "+line:" prepend , ] bi*
    ] { } make ;
<commit_msg>editors.jedit: return "jedit" when looking for jedit path<commit_after>! Copyright (C) 2004, 2010 <NAME>.
! See http://factorcode.org/license.txt for BSD license.
USING: combinators.short-circuit editors io.pathnames
io.standard-paths kernel make math.parser namespaces sequences
system ;
IN: editors.jedit

SINGLETON: jedit
jedit editor-class set-global

ERROR: jedit-not-found ;

HOOK: find-jedit-path os ( -- path )

M: object find-jedit-path "jedit" ;

M: macosx find-jedit-path
    "org.gjt.sp.jedit" find-native-bundle
    dup [ "Contents/MacOS/jedit" append-path ] when ;

M: windows find-jedit-path
    { "jedit" } "jedit.exe" find-in-applications ;
    
: jedit-path ( -- path )
    \ jedit-path get-global [
        find-jedit-path "jedit" or
    ] unless* ;

M: jedit editor-command ( file line -- command/f )
    [
        find-jedit-path ,
        "-reuseview" ,
        [ , ] [ number>string "+line:" prepend , ] bi*
    ] { } make ;

{'fraction_non_alphanumeric': 0.13867822318526543, 'fraction_numerical': 0.00866738894907909, 'mean_word_length': 2.808247422680412, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5809167', 'n_tokens_mistral': 684, 'n_tokens_neox': 661, 'n_words': 157}