Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

deleting bullet from normal makes things weird #2

Closed
davidosomething opened this issue Mar 22, 2024 · 3 comments
Closed

deleting bullet from normal makes things weird #2

davidosomething opened this issue Mar 22, 2024 · 3 comments
Labels
bug Something isn't working duplicate This issue or pull request already exists

Comments

@davidosomething
Copy link

- [XDG] compliance wherever possible to keep `$HOME` clean
  - See [Arch Linux wiki for XDG Base Directory Support]
  - See [Debian DotFilesList]
  - See [grawity's notes] and [environ notes]
- RC files for Lua, markdownlint, node, PHP, python, R, and others

cursor on first bullet, hit x to delete

expected: no change to virtual bullets
observed: virtual bullet is rendered on second line first column

@MeanderingProgrammer
Copy link
Owner

Interesting, thanks for reporting this bug!

I found that it only happens if you go from the first item in a list directly to a nested list.

So you get the same bug with this list:

- List Item 1
  - Nested List Item

But not with this list:

- List Item 1
- List Item 2
  - Nested List Item

I'll see if I can figure out what's going on with the parser, I imagine something to do with starting with a nested list isn't being handled ideally, I can probably add some simple condition to at least avoid the weird rendering.

@MeanderingProgrammer MeanderingProgrammer added the bug Something isn't working label Mar 22, 2024
@MeanderingProgrammer
Copy link
Owner

This ends up being the same problem as: #5

Basically anything that doesn't follow the space pattern of 0, 2, 4, ... will end up with extra spaces on the first list item from tree-sitter.

In this case the pattern ends up breaking breaking because removing the '-' causes the first item to be indented 2 instead of 0, so tree-sitter captures the leading 2 spaces.

From there my logic simply puts the bullet point at the start of the list.

Will track the fix through #5, resolving this one as a duplicate.

@MeanderingProgrammer MeanderingProgrammer added the duplicate This issue or pull request already exists label Mar 22, 2024
MeanderingProgrammer added a commit that referenced this issue Mar 22, 2024
## Details

As reported in the following issues:

* #2
* #5

The list_items we capture from tree-sitter will sometimes have
leading spaces leading to us rendering a bullet point incorrectly.

Add some logic on our side to handle these cases.
@MeanderingProgrammer
Copy link
Owner

Issue should be resolved by: df98da8

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
bug Something isn't working duplicate This issue or pull request already exists
Projects
None yet
Development

No branches or pull requests

2 participants