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

Flag/configuration to shorten deep nested paths #118

Closed
QwertyManiac opened this issue May 18, 2015 · 4 comments
Closed

Flag/configuration to shorten deep nested paths #118

QwertyManiac opened this issue May 18, 2015 · 4 comments

Comments

@QwertyManiac
Copy link

On limited screen width, or for heavily nested directory projects (such as apache/hadoop) the path picker output for a grep result becomes unusable as it only shows the directory paths than the filenames (the lines don't appear to wrap around).

It would be nice to show the paths in git style perhaps, with '…' replacing the initial directories so the shown focus may instead be on the filenames. This could also be configurable, if not desirable by all.

screen shot 2015-05-18 at 10 27 36 am

@lastquestion
Copy link
Contributor

I thought about this and maybe we can support left and right arrow to page screen width to the left and right. I'd rather do that then '...' abbrev.

To do this, we'd probably want to use pad or implement a more generic dirty / scroll mechanism. Something I'll think about after trying to get a pad PR out.

Not sure how @pcottle feels...

@pcottle
Copy link
Contributor

pcottle commented May 20, 2015

I thought about this and maybe we can support left and right arrow to page screen width to the left and right. I'd rather do that then '...' abbrev.

Hrm, I'd rather actually do the abbreviation to be honest so the relevant parts fit in the screen and i don't have to scroll over. it'd also be helpful if you had output like

./somethingsuperlongggggggggggggggggggggggggggggg/a1
./somethingsuperlongggggggggggggggggggggggggggggg/a2
./otherThingHere
./OtherThingThere
./somethingsuperlongggggggggggggggggggggggggggggg/a3

having to bounce back and forth between sides of the screen would be tough.

I don't think a flag would make sense here though -- we should just do this if your file match length is way too long compared to the chrome boundaries.

my only worry is how to implement the shortening logic -- @QwertyManiac would just showing the filename work for your case?

actually @lastquestion we could do something interesting here and more intelligent than git -- we could just use up all the available space, so itd be something like

./hadoop-mapreduce-|...|/client-hs/something-else.py | [f] is to select
./hadoop-mapreduce-|...|/client-hs/something-cool.py | [j] is to go down

aka write up all the way until the chrome

@lastquestion
Copy link
Contributor

Your argument is sound, it would be annoying to bounce back and forth.

We should abbrev so that it "just fits" inside the chrome, which is actually a great feature, because right now I think most console break the line, which makes "click to select" the biggest pain ever. I know I've done the thing where you select half the line, copy, select the other half, go back halfway to add the missing '/', all the while cursing...

Because we are a pipe, I think the tools before us assume "infinite width screen", basically, so we have the full path = good so we can resolve it, and we can abbrev as we wish dynamically on display.

Let's abbrev dynamically "all the way up to the chrome".

If we get the abbrev algorithm wrong and ppl complain, we can add a feature to "unabbrev" with say "." as the key and then it could allow left|right paging. but let's try without first, I am pretty sure if we do a dumb algo that makes sure the filename is always visible and abbrevs the middle 99% of people will be happy.

@pcottle
Copy link
Contributor

pcottle commented May 22, 2015

workz

I got this working pretty well! even responds to screen refreshes

pcottle added a commit that referenced this issue May 22, 2015
Awesomeeee long file truncation Resolves #118
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

No branches or pull requests

3 participants