]> gitweb.factorcode.org Git - factor.git/blob - basis/editors/notepadnext/notepadnext.factor
editors.notepadnext: add support for NotepadNext
[factor.git] / basis / editors / notepadnext / notepadnext.factor
1 ! Copyright (C) 2024 Doug Coleman.
2 ! See https://factorcode.org/license.txt for BSD license.
3 USING: editors io.pathnames io.standard-paths kernel make system ;
4 IN: editors.notepadnext
5
6 SINGLETON: notepadnext
7
8 HOOK: find-notepadnext-path os ( -- path )
9
10 M: macosx find-notepadnext-path
11     "com.yourcompany.NotepadNext" find-native-bundle [
12         "Contents/MacOS/NotepadNext" append-path
13     ] [
14         f
15     ] if* ;
16
17 M: windows find-notepadnext-path
18     { "Notepad Next" } "NotepadNext.exe" find-in-applications
19     [ "NotepadNext.exe" ] unless* ;
20
21 M: linux find-notepadnext-path
22     "NotepadNext" find-in-path ;
23
24 M: notepadnext editor-command
25     '[
26         find-notepadnext-path ,
27         _ ,
28         _ drop ! "-n" , _ ,
29     ] { } make ;