tree-sitter-markdown icon indicating copy to clipboard operation
tree-sitter-markdown copied to clipboard

Nested list item with 4 indents is concealed unexpectedly

Open amuuname opened this issue 1 year ago • 5 comments

Describe the bug First of all, thanks for working on this amazing parser!

After the recent update, the list_marker of the first nested list item with 4 spaces is concealed to nothing (``) while the following nested list items are concealed as expected. Please refer to below example.

Code example

- a list item with 4 spaces
    - first nested list item  <-- the `list_marker_minus` is concealed to blank
    - second nested list item <-- conceal works fine
    - third & more list items <-- conceal works fine

- a list item with 2 spaces
  - first nested list item <-- works fine
  - more items             <-- works fine

Expected behavior List item marker (-,+,*) should be concealed regardless of the tab size (2 or 4)

amuuname avatar Nov 29 '23 11:11 amuuname

Apologies, this is an issue with nvim-treesitter, see this issue

ribru17 avatar Nov 29 '23 19:11 ribru17

Ah-ha! Didn't notice there was an existing issue. Thank you! :)

amuuname avatar Nov 29 '23 19:11 amuuname

That commit has been reverted; nevertheless, the original cause is due to the parser capturing inconsistent (item number dependent) whitespace around the marker. If this can be fixed, we can re-enable those conceals. (If not, this issue can be closed.) @MDeiml

clason avatar Nov 30 '23 09:11 clason

So the first list item captures more whitespace (before the marker) than the following ones? Gonna check that out when I have time.

MDeiml avatar Nov 30 '23 09:11 MDeiml

The second does; see the the screenshot from the linked issue: image

clason avatar Nov 30 '23 09:11 clason