OXY2DEV / markview.nvim

An experimental markdown previewer for Neovim
Apache License 2.0
601 stars 23 forks source link

[BUG] Code indent not working properly after list item #27

Closed Rizhiy closed 5 days ago

Rizhiy commented 5 days ago

See: """"

  1. Item

    import os
    
    import more

    """ Rendered as: image

OXY2DEV commented 5 days ago

Can you check it now?

Screenshot_2024-07-06-07-07-32-838_com termux-edit

Rizhiy commented 3 days ago

That problem is gone, but now there is another) image

Please note: the line between imports is completely empty.

OXY2DEV commented 3 days ago

That problem is gone, but now there is another) image

Please note: the line between imports is completely empty.

The plugin no longer adds padding to empty lines. It was removed due to not working as intended.

Rizhiy commented 3 days ago

Well it doesn't need to add padding, just render the code block properly.

OXY2DEV commented 3 days ago

Well it doesn't need to add padding, just render the code block properly.

That's not how virtual text works.

You need something on the line where the plugin will try to add decorations.

Or else it will be added to the start of the line.

Before empty lines in list_items would get padding added to them(regardless of whether they are empty or not).

This unfortunately doesn't quite work. There are cases where you have a list followed by a table. In that case the top border of the table will get messed up.

Or in case you have a list and multiple empty lines after it the plugin will add padding to all of those empty lines(this is from treesitter so not much can be done here). This is bad when you have a list at the end of a file.

There will probably be some forms of limit to how many empty lines are considered part of the list. But for now, you just have to add spaces to empty lines.

Rizhiy commented 2 days ago

Maybe add padding only inside code blocks?