Ticket #486 (closed defect: fixed)

Opened 2 months ago

Last modified 5 days ago

Extremely long filenames clipped using filename completion

Reported by: rob Owned by: rob
Priority: minor Milestone: 0.7.6
Component: application Keywords:
Cc:

Description

From Christopher Armstrong on peppy-dev:

Whenever I have a giant path in the C-x C-f minibuffer I can't see what the possible completions are. I'd take a screenshot, but pressing my printscreen key makes the popup of completions disappear. The dropdown menu can only be as wide as the containing window, and the pathnames are justified such that I see the (boring) beginning part of them, instead of the (interesting) end, which includes the filename.

Attachments

Change History

Changed 2 months ago by radix

You said in email:

"I could remove all the common characters from the beginning of each item in the dropdown list, but that might look weird because you'll be completing on a path but only the filename will show up. To do it right, a VListBox will probably have to be implemented from scratch where I can align stuff to the right side of the popup."

I think this is pretty reasonable. You may not want to remove common characters, but instead just populate it with the basename the current completions. I think that's fine because it's actually what you're actually looking for; you've already typed the path into the minibuffer itself, and you can see where you are by looking at that.

(I remembered I have a trac account here. I'll report bugs like this directly to trac next time instead of the mailing list)

Changed 2 months ago by rob

Code snippet from Jesse Aldridge so I don't lose it:

paths = ["/home/jesse/synch/python/foo/bar/baz", "/whatever"] max_length = 20 displayed_paths = {} for path in paths: if len(path) > max_length: displayed_paths[path] = "..." + path[-max_length:] else: displayed_paths[path] = path for key, value in displayed_paths.iteritems(): print key, ":", value """ Prints: /whatever : /whatever /home/jesse/synch/python/foo/bar/baz : ...h/python/foo/bar/baz """

Changed 2 months ago by rob

D'oh. Use preview next time...

paths = ["/home/jesse/synch/python/foo/bar/baz", "/whatever"]
max_length = 20

displayed_paths = {}
for path in paths:
    if len(path) > max_length:
        displayed_paths[path] = "..." + path[-max_length:]
    else:
        displayed_paths[path] = path
   
for key, value in displayed_paths.iteritems():
    print key, ":", value
"""
Prints:
/whatever : /whatever
/home/jesse/synch/python/foo/bar/baz : ...h/python/foo/bar/baz

Changed 5 days ago by rob

(In [1598]) Refs #486: Changed from HtmlListBox? to VListBox in preparation to fix the clipping of long names

Changed 5 days ago by rob

  • status changed from new to closed
  • resolution set to fixed

(In [1599]) Fixed #486: popup now right-aligns long entries when completing text

Add/Change #486 (Extremely long filenames clipped using filename completion)

Author



Action
as closed
Next status will be 'reopened'
 
Note: See TracTickets for help on using tickets.