]> gitweb.factorcode.org Git - factor.git/commitdiff
editors.notepadnext: add support for NotepadNext
authorDoug Coleman <doug.coleman@gmail.com>
Thu, 28 Mar 2024 19:23:46 +0000 (14:23 -0500)
committerDoug Coleman <doug.coleman@gmail.com>
Thu, 28 Mar 2024 19:23:46 +0000 (14:23 -0500)
it doesn't seem to open to line numbers in files

basis/editors/notepadnext/authors.txt [new file with mode: 0644]
basis/editors/notepadnext/notepadnext.factor [new file with mode: 0644]
basis/editors/notepadnext/summary.txt [new file with mode: 0644]

diff --git a/basis/editors/notepadnext/authors.txt b/basis/editors/notepadnext/authors.txt
new file mode 100644 (file)
index 0000000..7c1b2f2
--- /dev/null
@@ -0,0 +1 @@
+Doug Coleman
diff --git a/basis/editors/notepadnext/notepadnext.factor b/basis/editors/notepadnext/notepadnext.factor
new file mode 100644 (file)
index 0000000..66157c4
--- /dev/null
@@ -0,0 +1,29 @@
+! Copyright (C) 2024 Doug Coleman.
+! See https://factorcode.org/license.txt for BSD license.
+USING: editors io.pathnames io.standard-paths kernel make system ;
+IN: editors.notepadnext
+
+SINGLETON: notepadnext
+
+HOOK: find-notepadnext-path os ( -- path )
+
+M: macosx find-notepadnext-path
+    "com.yourcompany.NotepadNext" find-native-bundle [
+        "Contents/MacOS/NotepadNext" append-path
+    ] [
+        f
+    ] if* ;
+
+M: windows find-notepadnext-path
+    { "Notepad Next" } "NotepadNext.exe" find-in-applications
+    [ "NotepadNext.exe" ] unless* ;
+
+M: linux find-notepadnext-path
+    "NotepadNext" find-in-path ;
+
+M: notepadnext editor-command
+    '[
+        find-notepadnext-path ,
+        _ ,
+        _ drop ! "-n" , _ ,
+    ] { } make ;
diff --git a/basis/editors/notepadnext/summary.txt b/basis/editors/notepadnext/summary.txt
new file mode 100644 (file)
index 0000000..4caba5d
--- /dev/null
@@ -0,0 +1 @@
+NotepadNext editor integration