Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

commander: small improvement on listing and panel width #1394

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

icy
Copy link

@icy icy commented Dec 14, 2024

Motivation

When working with different directories that have some common files that have long full path names, it's hard to find the right file from the list. This is because the panel's width is 500 and the full path may not be shown completely within the panel as below

<-------- visible to  user --------> <----- invisible to users ------------------->

/-----------------------------------\
| /foo/bar/directory/with/very/long-|/path/name1/sample.txt
| Files -> Recent Files -> /foo/bar/|directory/with/very/long-/path1/name/sample.txt
| /foo/bar/directory/with/very/long-|/path/name2/sample.txt
| Files -> Recent Files -> /foo/bar/|directory/with/very/long-/path2/name/sample.txt
\-----------------------------------/

In this illustration, when looking up sample.txt, the user has no idea about the directory information (both path/name1 and path/name2 do matching)

The patches

  • The panel's width is one half of the width of the Geany window when this amount is greater than or equals to 250
  • Otherwise the panel's width defaults to the width of the Geany window
  • For labels, don't display full names; only display the parent directory's basename and the file name

The previous illustration now becomes

/-----------------------------------\
| name1/sample.txt                  |
| Files -> Recent Files -> /foo/bar/|directory/with/very/long-/path/name1/sample.txt
| name2/sample.txt                  |
| Files -> Recent Files -> /foo/bar/|directory/with/very/long-/path/name2/sample.txt
\-----------------------------------/

and this helps user to quickly find the right files.

Of course this doesn't solve all edge cases when there are a few more levels of duplication in full path names.

icy added 3 commits December 12, 2024 09:01
When working with multiple similar folders that have some common filenames,
it's pretty hard to guess the right file we want to pick up. This simple hack
extends the panel width to address this issue.

TODO/FIXME:
- [ ] Make this optional configuration
- [ ] Do not print full path of files
Old behavior: When listing file paths, we have two ways: one to display basename
the other is to display full path (for items fetched from menu items)

New behavior: Display dir_name/base_name in  both cases, making it easier
to find things. The menu box is extended so if some more information is needed,
it can be looked up the itemized line (always full path)
When the width of the Geany (main) window >= 500, the panel tries a half
of that size as  the default width.  Otherwise, it gets the same width
as the Geany window.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant