[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Ranger-users] ranger 1.6.0 on the horizon

From: Joshua Landau
Subject: Re: [Ranger-users] ranger 1.6.0 on the horizon
Date: Sat, 16 Feb 2013 20:48:53 +0000

On 15 February 2013 20:38, Roman Z. <address@hidden> wrote:
> > Unfortunately with the new versions I'm not really sure what a patch would
> > entail. Adding the commands to commands.py is easy, but I'm using
> >
> > directory.tmp_filter = "THE FILTER GOES HERE"
> > directory.tmp_filter_dir = "THE DIRECTORY WE'RE FILTERING GOES HERE"
> >
> > which seems like a bad thing to have in production code.
> Ok im gonna look how I can integrate it cleanly into ranger.

I added the :travel and :narrow commands.  The hack is not needed
anymore since I added a "temporary_filter" variable to directories.
Since I modified the code a bit, can you try them out and say how you
like them?

I like it ^^. I like what you did to clean up :travel, too. Other than the one point below, they seem great and much less hacky than mine.

I see you went back to Regex, though.  Open :narrow and press "*". The Regex will be malformed, so Ranger will crash.
Try using "\."; now try "[ab]", now try "(ab)", now try...

Obviously you'd want to catch the error, but I'm not sure what the obvious course of action would be from there. That's part of why I stuck with the simple world of string matching.

You could just wait until it's properly formed before continuing. But then..
"\." changes to "\.*..*", which isn't what you wanted..
"[ab]" changes to "[.*a.*b.*].*", which isn't what you wanted..
"(ab)" changes to "(.*a.*b.*).*", which isn't what you wanted..
So why use Regex?

I really do get that characters like "$" are quite useful (srsly), but special cases can more easily be added to simple stuff than all the difficulties removed from regex ;).
> ^D closes bash.

FYI with ^D i mean Ctrl+D.

That deletes a character in front of the cursor for me (Zsh).

reply via email to

[Prev in Thread] Current Thread [Next in Thread]