you can't navigate into some folders when they have similar names

Bug #675016 reported by Paweł Bara
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Cardapio
Fix Released
Low
Unassigned

Bug Description

My /usr folder contains four folders starting with "lib", namely:

lib64
libexec
lib
lib32

Let's say I want to get into /usr/lib. I enter "/usr/lib/" into the search entry and what happens...? I'm now in "/usr/lib64/"! That's because the elements are sorted like I showed earlier and Cardapio navigates into the first one on the list of similiar items.

This should work like this: if there is an exact match (like "/usr/lib" in our case), use it. Otherwise, just take the first element on the list.

Paweł Bara (keirangtp)
Changed in cardapio:
importance: Undecided → Low
Revision history for this message
Thiago Teixeira (tvst) wrote :

Ok, I have partially fixed this by sorting the results alphabetically. This will fix most use cases, including the one you posted above. It also makes the results prettier :)

An example use case where this doesn't fix the bug is when you're searching for "lib" and the directory contains an entry called "alib". This would lead to results like:

alib
lib
lib32
zlib

Then, to peek into the lib folder, you'd need to press Tab, then Down, then slash / , as usual.

For now I think it's best to not try to solve the case above. Instead, the best solution would be to move from a simple filename search to an edit-distance based search. This means using something like the Levenshtein or difflib modules (http://stackoverflow.com/questions/682367/good-python-modules-for-fuzzy-string-comparison)

Revision history for this message
Paweł Bara (keirangtp) wrote :

Yeah, that's definitely a partial fix because we just replaced a problem with another one (only deterministic this time).

Also, the Levenstein is actually a very good idea since it's also typos aware!

Revision history for this message
Thiago Teixeira (tvst) wrote :

Marking this as "fix released" as the code has just hit the PPA (v0.9.157).

We can go Levenshtein some other time :)

Changed in cardapio:
status: New → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.