noice.nvim icon indicating copy to clipboard operation
noice.nvim copied to clipboard

Blank line at the top(or bottom) of lsp window and no way remove it

Open leaxoy opened this issue 1 year ago • 6 comments

Hover

image

Signature

image

Completion

image

leaxoy avatar Oct 29 '22 03:10 leaxoy

I think those blank lines aren't that blank after all. Those are code blocks with language not visible in the markdown preview. Nevertheless, it would be good to get rid of them :D

Screenshot 2022-10-29 at 09 22 05

pBorak avatar Oct 29 '22 07:10 pBorak

You are right, that makes sense.

leaxoy avatar Oct 29 '22 08:10 leaxoy

In the default Neovim lsp markdown renderer, we strip the begininig and end of code blocks and use syn-region to highlight the syntax.

The new Noice markdown renderer uses Treesitter under the hood, since it is by far superior in terms of highlighting and concealing, but the Treesitter highlighter currently doesn't support highlighting regions.

I'm planning to make a PR upstream to make this possible.

Once that's done, I can use that to strip those lines.

folke avatar Oct 29 '22 08:10 folke

Another issue maybe also related to this. image The last row in this case is a markdown link. Window's width is not rendering correctly. It's should same with the length second last row.

leaxoy avatar Oct 29 '22 09:10 leaxoy

There's no way to caculate the concealed str width as far as I know. So that's why the window width is wider

folke avatar Oct 29 '22 09:10 folke

Indeed, it's a small problem, does't affecting the rest of the awesome features

leaxoy avatar Oct 30 '22 02:10 leaxoy

couldn't this be done with injections @folke or have I missunderstood something?

max397574 avatar Nov 07 '22 21:11 max397574

@max397574 what do you mean?

The markdown code blocks are using injections.

Either we need anti-conceal to remove lines from the buffer, or we need a way to highlight a region with treesitter. The last option is what I'm going to see to implement upstream.

folke avatar Nov 08 '22 08:11 folke

I thought with the "highlight a region" you meant sth like injections

max397574 avatar Nov 08 '22 08:11 max397574