finalterm icon indicating copy to clipboard operation
finalterm copied to clipboard

Hover line can clip off the side of the window

Open mttr opened this issue 11 years ago • 3 comments

I'm a bit hesitant to post this since I have a hard time imagining that it hasn't been caught yet (perhaps it's just too minor of a bug to worry about right now?), but here goes:

hover_line_clipping

As you can see, the "File" portion of the hovertext gets cut off by the right side of the window. This is obviously undesirable. I made some quick changes in the code to see what it would look if the label was moved to the left side of the hover line, and came up with this (the code for this change can be found here):

alternative_hover_line

I haven't had a chance to see if this has a negative impact on anything else at the time. Perhaps, ideally, it would be best to only do this if the hover line would otherwise attempt to partially draw off-screen?

Regardless, I felt it best to post here before moving further.

Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

mttr avatar Jul 10 '13 21:07 mttr

Well, the negative impact is that the same thing will happen now if the item is on the right of the screen (such as with ls -l) :)

A solution would be to detect this and move the description to either left or right depending on the position of the item. However, another, bigger, issue remains: When long filenames get wrapped across lines (if FT is resized for example), the button will get cut off nontheless.

The best solution, solving all of these problems, would be to make the button independent of the window and have it extend beyond it if necessary, such as the autocompletion popup does already. However, that would be considerably more difficult than the current method.

p-e-w avatar Jul 11 '13 04:07 p-e-w

Making the button independent of the window will have a problem too: if finalterm is against the left/right side of the screen, the text will still cut off. @p-e-w's second option is probably best. It will just need an additional check: if the item is wrapped, determine where it is wrapped and make the popup wrap at the same position.

spamalot avatar Jul 11 '13 17:07 spamalot

I imagine that wrapping the popup will be quite difficult as well.

p-e-w avatar Jul 11 '13 17:07 p-e-w