tooltip: improve resizing and text wrapping logic

Fixes cases where the tooltip would wrap the text in unnecessary situations

And also removes the scrollbar margins when theres no scrollbar

example with typescript LSP:

before:

image

after:

image

it also fixes horizontal scrollbars sometimes making tooltips completely unusable (example with json LSP):

before:

image image

after:

image image

would appreciate some testing with other language servers, i mostly tested it with cland, typescript LSP, and json LSP, and didn't find any situation where it looks worse than before

Merge request reports

Loading