forked from factor/factor
-
Notifications
You must be signed in to change notification settings - Fork 0
/
notepadnext.factor
33 lines (27 loc) · 901 Bytes
/
notepadnext.factor
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
! Copyright (C) 2024 Doug Coleman.
! See https://factorcode.org/license.txt for BSD license.
USING: editors io.pathnames io.standard-paths kernel make sequences system ;
IN: editors.notepadnext
SINGLETON: notepadnext
HOOK: find-notepadnext-path os ( -- path line#? )
M: macosx find-notepadnext-path
{
"com.yourcompany.NotepadNext"
"io.github.dail8859.NotepadNext"
} [
find-native-bundle [
"Contents/MacOS/NotepadNext" append-path
] [
f
] if*
] map-find "io.github.dail8859.NotepadNext" = ;
M: windows find-notepadnext-path
{ "Notepad Next" } "NotepadNext.exe" find-in-applications
[ "NotepadNext.exe" ] unless* t ;
M: linux find-notepadnext-path
"NotepadNext" find-in-path t ;
M: notepadnext editor-command
'[
find-notepadnext-path
[ , _ , ] [ [ "-n" , _ , ] when ] bi*
] { } make ;