try the binary name alone if the editor can't be found in the default location
[factor/jcg.git] / basis / editors / notepad2 / notepad2.factor
blobdc1a8a7991e62e72454bf26443f1ee04433c0107
1 USING: editors io.files io.launcher kernel math.parser
2 namespaces sequences windows.shell32 make io.pathnames ;
3 IN: editors.notepad2
5 : notepad2-path ( -- path )
6     \ notepad2-path get-global [
7         windows-directory "system32\\notepad.exe" append-path
8         [ "notepad.exe" ] unless*
9     ] unless* ;
11 : notepad2 ( file line -- )
12     [
13         notepad2-path ,
14         "/g" , number>string , ,
15     ] { } make run-detached drop ;
17 [ notepad2 ] edit-hook set-global