Add edit-file and edit-vocab words and make edit on strings call

edit-vocab.
db4
Doug Coleman 2011-10-29 12:20:02 -07:00
parent eb7fd4a69b
commit 8205caa5ca
2 changed files with 9 additions and 5 deletions

View File

@ -39,6 +39,14 @@ M: cannot-find-source error.
definition>> pprint-short definition>> pprint-short
"''" print ; "''" print ;
: edit-file ( path -- )
0 edit-location ;
DEFER: edit
: edit-vocab ( vocab -- )
dup lookup-vocab [ edit ] [ cannot-find-source ] ?if ;
GENERIC: edit ( object -- ) GENERIC: edit ( object -- )
M: object edit M: object edit
@ -46,8 +54,7 @@ M: object edit
M: link edit name>> edit ; M: link edit name>> edit ;
M: string edit M: string edit edit-vocab ;
dup lookup-vocab [ edit ] [ cannot-find-source ] ?if ;
: edit-error ( error -- ) : edit-error ( error -- )
[ error-file ] [ error-line ] bi [ error-file ] [ error-line ] bi

View File

@ -69,9 +69,6 @@ IN: ui.tools.operations
{ +secondary+ t } { +secondary+ t }
} define-operation } define-operation
! Pathnames
: edit-file ( pathname -- ) edit ;
[ pathname? ] \ edit-file H{ [ pathname? ] \ edit-file H{
{ +keyboard+ T{ key-down f { C+ } "b" } } { +keyboard+ T{ key-down f { C+ } "b" } }
{ +primary+ t } { +primary+ t }