about summary refs log tree commit diff stats
path: root/code/fm/keys.rb
diff options
context:
space:
mode:
authorhut <hut@lavabit.com>2009-06-13 02:20:46 +0200
committerhut <hut@lavabit.com>2009-06-13 02:20:46 +0200
commit2887ca25fb58362d5d644ecda5f0bc51c80ec404 (patch)
treeb066f5542d97b1a4a9134d0910692b873fe32363 /code/fm/keys.rb
parent325ec37f65172b5b640d998eba300d86d1ddbfa5 (diff)
downloadranger-2887ca25fb58362d5d644ecda5f0bc51c80ec404.tar.gz
rewrite of the way files are executed, easier config
Diffstat (limited to 'code/fm/keys.rb')
-rw-r--r--code/fm/keys.rb47
1 files changed, 4 insertions, 43 deletions
diff --git a/code/fm/keys.rb b/code/fm/keys.rb
index c7abea17..4e3af766 100644
--- a/code/fm/keys.rb
+++ b/code/fm/keys.rb
@@ -305,7 +305,7 @@ module Fm
 				if $3 == '<cr>'
 					closei
 					system("bash", "-c", $2)
-					gets unless $1.empty?
+					Action.wait_for_enter unless $1.empty?
 					starti
 					@pwd.schedule
 				end
@@ -522,47 +522,8 @@ module Fm
 		# w = wait for <enter> after execution
 		# capital letter inverts
 		when /^[ri](\d*)([adetw]*)[ri]$/
-			if $2.empty?
-				f = @marked.empty?? currentfile : @marked.first
-				flags = get_default_flags(f)
-			else
-				flags = $2
-			end
-			opt = OpenStruct.new
-			opt.newway = true
-
-			opt.mode = $1.to_i unless $1.empty?
-
-			# Set options based on flags
-			
-			if flags =~ /a/
-				opt.all = true
-			end
-			if flags =~ /[de]/
-				opt.detach = true
-			end
-			if flags =~ /t/
-				opt.new_term = true
-				opt.detach = true
-			end
-			if flags =~ /w/
-				opt.wait = true
-			end
-
-			if flags =~ /A/
-				opt.all = false
-			end
-			if flags =~ /[DE]/
-				opt.detach = false
-			end
-			if flags =~ /T/
-				opt.new_term = false
-			end
-			if flags =~ /W/
-				opt.wait = false
-			end
-
-			Action.run(opt.__table__)
+			run_context = RunContext.new(getfiles, $1, $2)
+			Action.run(run_context)
 		
 #		when 'ra'
 #			unless File.directory?(currentfile.path)
@@ -598,7 +559,7 @@ module Fm
 			cf = currentfile
 			enter = enter_dir_safely(cf.path)
 			unless enter
-				return Action.run(:detach=>false)
+				return Action.run(RunContext.new(getfiles))
 			end
 			return false
 		end