]> gitweb.factorcode.org Git - factor.git/commitdiff
editors.notepadnext: support line numbers in newer bundle id
authorJohn Benediktsson <mrjbq7@gmail.com>
Wed, 3 Apr 2024 02:26:04 +0000 (19:26 -0700)
committerJohn Benediktsson <mrjbq7@gmail.com>
Wed, 3 Apr 2024 02:26:04 +0000 (19:26 -0700)
basis/editors/notepadnext/notepadnext.factor

index 5450fd70b5200d9ddc5e9c8cc815107af98d8089..f6b10a3c5aaee52ff3dda43849acc41e5bcebbac 100644 (file)
@@ -1,28 +1,33 @@
 ! Copyright (C) 2024 Doug Coleman.
 ! See https://factorcode.org/license.txt for BSD license.
-USING: editors io.pathnames io.standard-paths kernel make system ;
+USING: editors io.pathnames io.standard-paths kernel make sequences system ;
 IN: editors.notepadnext
 
 SINGLETON: notepadnext
 
-HOOK: find-notepadnext-path os ( -- path )
+HOOK: find-notepadnext-path os ( -- path line#? )
 
 M: macosx find-notepadnext-path
-    "com.yourcompany.NotepadNext" find-native-bundle [
-        "Contents/MacOS/NotepadNext" append-path
-    ] [
-        f
-    ] if* ;
+    {
+        "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* ;
+    [ "NotepadNext.exe" ] unless* ;
 
 M: linux find-notepadnext-path
-    "NotepadNext" find-in-path ;
+    "NotepadNext" find-in-path ;
 
 M: notepadnext editor-command
     '[
-        find-notepadnext-path , _ ,
-        "-n" , _ ,
+        find-notepadnext-path
+        [ , _ , ] [ [ "-n" , _ , ] when ] bi*
     ] { } make ;