Closed Seich closed 3 years ago
Yes I'm aware of this problem, I'd also prefer to have only the head part of the path as it can get quite annoying with long paths. As far as I know, in FZF the function that builds the list and the action handler are independent, that's why the full path need to be in the list so that it can jump into it in the handler. But maybe I can find a workaround.
Well it's easier to do than I thought. I simply saved the full path of a FZF entry in a global variable that the jump handler has access to. Update the plugin and your issue should be resolved now.
I'm reopening this as I realized that using an incomplete modifier breaks the preview though.
I've looked into it and the executable preview.sh that FZF uses to display the preview assumes that an entry has a valid path (relative or absolute) as first element. So I cannot remove the path from the FZF entries unfortunately.
I could potentially call myself preview.sh
with the correct file path but that would add a lot of complexity to the code: FZF takes care of sanitizing the entries according to the user OS before calling preview.sh here and I'd like to keep the plugin simple.
But I've added the --keep-right
option so that if the line is too long, the line is displayed starting from the end. I hope that this fix is ok for you.
Hey @ojroques it works great! Thanks for taking a look so quickly! I have the preview disabled so your first fix is actually a better fit for me and I'll stay on it for the time being.
--keep-right
is certainly the correct fix for most cases nonetheless. Do you think it'd be worth it for it to be a setting? I understand if that goes against your objectives for the plugin though! Thanks again!
Great!
I've already added --keep-right
as a default setting in the latest commit, I think this is the behavior that people expect for long entries. Note that I have reverted the first fix in the latest commit to keep the preview working.
First of all, thanks for the great plugin!
I am trying to improve the document symbol window, right now it depends on showing the entire file path to move to the correct position so when my editor is small-ish it stops being useful:
Is there a way to get around that limitation? Changing the modifier eventually ends up breaking and opening new buffers with names which makes sense but hasn't gotten me any closer.
:p:t
for example looks great but falls into these (which to be fair the read me mentions)Any suggestions?