]> gitweb.factorcode.org Git - factor.git/blob - basis/editors/notepad/notepad.factor
editors.notepad: find notepad faster and fix compile error
[factor.git] / basis / editors / notepad / notepad.factor
1 ! Copyright (C) 2009 Doug Coleman.
2 ! See http://factorcode.org/license.txt for BSD license.
3 USING: arrays editors io.directories io.files io.pathnames
4 kernel namespaces sequences windows.shell32 ;
5
6 IN: editors.notepad
7
8 SINGLETON: notepad
9
10 editor-class [ notepad ] initialize
11
12 : notepad-path ( -- path )
13     \ notepad-path get [
14         windows-directory "notepad.exe" append-path
15         dup file-exists? [ drop f ] unless
16     ] unless* [
17         windows-directory
18         [ "notepad.exe" tail? ] find-file
19     ] unless* ;
20
21 M: notepad editor-command
22     drop [ notepad-path ] dip 2array ;