]> gitweb.factorcode.org Git - factor.git/commitdiff
editors.notepad: find notepad faster and fix compile error
authorDoug Coleman <doug.coleman@gmail.com>
Tue, 2 Aug 2022 13:15:11 +0000 (08:15 -0500)
committerDoug Coleman <doug.coleman@gmail.com>
Tue, 2 Aug 2022 13:15:11 +0000 (08:15 -0500)
basis/editors/notepad/notepad.factor

index cc672ebc2410038da98102774d06a4920f548daa..5eb20d24ffdbefce2797624c696cd19ee1a0b16a 100644 (file)
@@ -1,7 +1,7 @@
 ! Copyright (C) 2009 Doug Coleman.
 ! See http://factorcode.org/license.txt for BSD license.
-USING: arrays editors io.directories kernel namespaces
-sequences windows.shell32 ;
+USING: arrays editors io.directories io.files io.pathnames
+kernel namespaces sequences windows.shell32 ;
 
 IN: editors.notepad
 
@@ -11,7 +11,10 @@ editor-class [ notepad ] initialize
 
 : notepad-path ( -- path )
     \ notepad-path get [
-        windows-directory t
+        windows-directory "notepad.exe" append-path
+        dup file-exists? [ drop f ] unless
+    ] unless* [
+        windows-directory
         [ "notepad.exe" tail? ] find-file
     ] unless* ;