MeanderingProgrammer / render-markdown.nvim

Plugin to improve viewing Markdown files in Neovim
MIT License
1.73k stars 38 forks source link

feature: Option for removing top and bottom lines of code blocks #108

Closed serhez closed 3 months ago

serhez commented 3 months ago

Is your feature request related to a problem? Please describe.

Concealed backticks (e.g., ```) leave two additional empty lines on the top and bottom of code blocks. This does not look so good in LSP hover floating windows particularly. Given the new buftype override feature, it would be great to remove these lines completely, like the plugin noice.nvim does for example.

Describe the solution you'd like

Having an additional option in code.style to remove the backtick lines, beside the already existing none, normal, language and full.

Describe alternatives you've considered

N/A.

Additional information

No response

MeanderingProgrammer commented 3 months ago

noice is essentially generating a message from scratch: https://github.com/folke/noice.nvim/blob/main/lua/noice/text/markdown.lua#L167, so can easily add / remove text as needed, at least that's how I'm reading what it's doing.

This plugin is working with the underlying buffer and can't overwrite chunks of it. As far as I am aware the only way to remove lines is to do a fold, but a fold for a single line doesn't really work.

I'm open to PRs but don't think there's really a way to accomplish this.

serhez commented 3 months ago

That makes sense, thanks for the reply!