Custom modify previewer title on title overflow #1132
BSteffaniak
started this conversation in
Ideas
Replies: 2 comments 5 replies
-
That’s a good solution @BSteffaniak, the only exception is that I would prefer to avoid yet another obscure function, instead we can just add width as the second parameter to the already existing |
Beta Was this translation helpful? Give feedback.
0 replies
-
344b309 - this adds |
Beta Was this translation helpful? Give feedback.
5 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi. This might already be able to be achieved somehow, but I wasn't able to achieve it without modifying the source code myself.
I want to handle shortening an overflowed preview title by prepending a
...
to the front of the title and chopping off the left part of the title.e.g. if the title
this is a test title
only accepts 15 characters, it would shorten to...a test title
The way I handled this was to add an optional title_fnameoverflowmodify transformer to winopts.preview. I initially tried to add that to previewers.builtin, but I don't know how to access that from the win.lua#FzfWin:update_title function. If I could've found a way to access that in that function, I probably would have added it there. However, I'm not very familiar with lua, so I just added it to winopts.preview since that function was already using stuff from that.
I then used that title_fnameoverflowmodify in the update_title function like this:
With this, I then defined winopts.preview.title_fnameoverflowmodify in my setup config like this:
The result looks like this:
Is this achievable in a different -- less complex -- way? If not, does this seem like a good solution?
Thanks!
Beta Was this translation helpful? Give feedback.
All reactions