about summary refs log tree commit diff stats
path: root/code/keys.rb
diff options
context:
space:
mode:
authorhut <hut@lavabit.com>2009-07-21 04:28:37 +0200
committerhut <hut@lavabit.com>2009-07-21 04:28:37 +0200
commit24b8851bf5563550cc61ef7eb1707449312fedd0 (patch)
tree3b667a342e1d1544b3d60fbf15c8ad2f1f1f57a7 /code/keys.rb
parent0afab31a620df8bf45e60e66bfcce21b2c6b7f47 (diff)
downloadranger-24b8851bf5563550cc61ef7eb1707449312fedd0.tar.gz
made [r..r] more consistent with other commands
it's now r..<ENTER>
additionally, you can write a colon and an application name at the end,
to start the files with a specific application.
Diffstat (limited to 'code/keys.rb')
-rw-r--r--code/keys.rb17
1 files changed, 12 insertions, 5 deletions
diff --git a/code/keys.rb b/code/keys.rb
index eb4f086a..7b675c3a 100644
--- a/code/keys.rb
+++ b/code/keys.rb
@@ -369,9 +369,17 @@ module Fm
 				Action.run(RunContext.new(getfiles, nil, nil, 'editor'))
 			end
 
-		when /^[ri](\d*)(?i:([adetw]*))[ri]$/
-			run_context = RunContext.new(getfiles, $1, $2)
-			Action.run(run_context)
+		when /^r\s?(.*)$/
+			if_enter_pressed($1) do |arg|
+				@buffer.clear
+
+				info, app = arg.split(":", 2)
+				info =~ /(\d*)([adetw]*)/i
+				mode, flags = $1, $2
+
+				run_context = RunContext.new(getfiles, mode, flags, app)
+				Action.run(run_context)
+			end
 
 		when "-", "="
 			val = "2#{key=='-' ? '-' : '+'}"
@@ -599,8 +607,7 @@ module Fm
 
 			/:[^<]*/
 			/[fF/!].*/
-			/r\d*\w*[^r]/
-			/(cw|cm|co|cd|mv|gf).*/
+			/(r|cw|cm|co|cd|mv|gf).*/
 			/b(l(o(c(k(.*)?)?)?)?)?/
 			/g(r(e(p(.*)?)?)?)?/
 			/m(k(d(i(r(.*)?)?)?)?)?/