]> gitweb.factorcode.org Git - factor.git/commitdiff
Add edit-file and edit-vocab words and make edit on strings call
authorDoug Coleman <doug.coleman@gmail.com>
Sat, 29 Oct 2011 19:20:02 +0000 (12:20 -0700)
committerDoug Coleman <doug.coleman@gmail.com>
Sat, 29 Oct 2011 20:35:13 +0000 (13:35 -0700)
edit-vocab.

basis/editors/editors.factor
basis/ui/tools/operations/operations.factor

index 38978d3dc2f5de5d0e2a0e76de127717af48be58..b7a420c6d104101afef0ae949d24317a1c65aa11 100644 (file)
@@ -39,6 +39,14 @@ M: cannot-find-source error.
     definition>> pprint-short
     "''" print ;
 
+: edit-file ( path -- )
+    0 edit-location ;
+
+DEFER: edit
+
+: edit-vocab ( vocab -- )
+    dup lookup-vocab [ edit ] [ cannot-find-source ] ?if ;
+
 GENERIC: edit ( object -- )
 
 M: object edit
@@ -46,8 +54,7 @@ M: object edit
 
 M: link edit name>> edit ;
 
-M: string edit
-    dup lookup-vocab [ edit ] [ cannot-find-source ] ?if ;
+M: string edit edit-vocab ;
 
 : edit-error ( error -- )
     [ error-file ] [ error-line ] bi
index 5ae86f4a137d1b0c6a2665410b52247922689485..fe8bb95623cb4b1bee8645880e10d9cfeb5ae820 100644 (file)
@@ -69,9 +69,6 @@ IN: ui.tools.operations
     { +secondary+ t }
 } define-operation
 
-! Pathnames
-: edit-file ( pathname -- ) edit ;
-
 [ pathname? ] \ edit-file H{
     { +keyboard+ T{ key-down f { C+ } "b" } }
     { +primary+ t }