From 24b8851bf5563550cc61ef7eb1707449312fedd0 Mon Sep 17 00:00:00 2001 From: hut Date: Tue, 21 Jul 2009 04:28:37 +0200 Subject: made [r..r] more consistent with other commands it's now r.. additionally, you can write a colon and an application name at the end, to start the files with a specific application. --- code/help.rb | 3 ++- 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 - rr Run with mode and flags . example: r3adr + r Run with mode and flags . example: r3ad Default mode: 0, default flags: no flags at all + r: 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(.*)?)?)?)?)?/ -- cgit 1.4.1-2-gfad0