diff options
author | hut <hut@lavabit.com> | 2009-07-21 04:28:37 +0200 |
---|---|---|
committer | hut <hut@lavabit.com> | 2009-07-21 04:28:37 +0200 |
commit | 24b8851bf5563550cc61ef7eb1707449312fedd0 (patch) | |
tree | 3b667a342e1d1544b3d60fbf15c8ad2f1f1f57a7 /code | |
parent | 0afab31a620df8bf45e60e66bfcce21b2c6b7f47 (diff) | |
download | ranger-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')
-rw-r--r-- | code/help.rb | 3 | ||||
-rw-r--r-- | code/keys.rb | 17 |
2 files changed, 14 insertions, 6 deletions
diff --git a/code/help.rb b/code/help.rb index bd6568c4..3cb5a0d7 100644 --- a/code/help.rb +++ b/code/help.rb @@ -160,8 +160,9 @@ module Fm l or RIGHT Enter the directory or run the file in mode 0, flag "a" L Run in a different way: mode 1, no flags - r<n><f>r Run with mode <n> and flags <f>. example: r3adr + r<n><f> Run with mode <n> and flags <f>. example: r3ad Default mode: 0, default flags: no flags at all + r<n><f>:<a> Run with a specific application. example: r4t:mplayer i and I Like l and L but without the flag "a" What are flags: 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(.*)?)?)?)?)?/ |