MeanderingProgrammer / markdown.nvim

Plugin to improve viewing Markdown files in Neovim
MIT License
504 stars 20 forks source link

Custom head1 emoji can't attach a empty space #35

Closed xixiaofinland closed 1 month ago

xixiaofinland commented 1 month ago

When customizing heads' and bulletpoints' emoji icons, H1 and bullet points can't use "a space" after the icon, like my current config here

Taking H1 as an example, if I add the space after the icon (i.e. '🐹 ' rather than '🐹'), the first char ('f') after the H1 is overlapped (screenshot below) Image 007

Here is the text version Image 008

This issue doesn't apply to H2, H3....

MeanderingProgrammer commented 1 month ago

Yeah, this is due to the number of characters we have on an h1. Since it's only the single # and the space, there are only 2 characters available to us before we start overwriting the title. Some more details on it here: https://github.com/MeanderingProgrammer/markdown.nvim/issues/12#issuecomment-2035556921.

I've added this as a known limitation for the time being. I'm not sure if I want to fix this, messing with text positioning is not something I want this plugin to do in general. Ideally it is just an overlay over top of the raw text rather than something that does a lot of displacing.

xixiaofinland commented 1 month ago

I see, thanks for the explanation. I agree it's better to keep it simple and not mess up with the original text.

MeanderingProgrammer commented 1 week ago

I did push a fix for this here https://github.com/MeanderingProgrammer/markdown.nvim/commit/5ce35662725b1024c6dddc8d0bc03befc5abc878, if you want to try using longer icons / text and are using neovim >= 0.10.0.

xixiaofinland commented 1 week ago

Thanks for notifying! I will give it a try