From 1c5184528eb436e0775a59cdcd6aa64744f36c9a Mon Sep 17 00:00:00 2001 From: hut Date: Mon, 20 Jul 2009 18:08:52 +0200 Subject: added an easy "edit" function --- code/fm.rb | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/code/fm.rb b/code/fm.rb index dff94c7a..4f1a5742 100644 --- a/code/fm.rb +++ b/code/fm.rb @@ -58,6 +58,16 @@ module Fm end end + def edit( filename, mode=nil, flags=nil ) + file = Directory::Entry.new( filename ) + file.refresh + raise "File doesn't exist" unless file.exists? + runcontext = RunContext.new( file, mode, flags, 'editor' ) + externally do + Action.run( runcontext ) + end + end + def reload_types() old_verbose_level = $VERBOSE $VERBOSE = nil -- cgit 1.4.1-2-gfad0