Skip to content

Fix checkbox indent #31

New issue

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

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

Already on GitHub? Sign in to your account

Closed

Conversation

masa0x80
Copy link

It was good that the commit e38795f made the list markers invisible, but there was a problem with indentation broken when the list and checkboxes coexisted only by hiding the list markers.

Replacing the combination of list markers and checkboxes with the virtual text of the checkboxes solved the indentation problem.

before after
before after

masa0x80 added 2 commits June 1, 2024 00:11
The combination of a list marker and a checkbox is replaced by the virtual text of the checkbox.
By this,
````
unchecked = '󰄱    ',
checked = '    ',
```
would align the indentation of normal bullets and checkboxes, and
```
unchecked = '󰄱 ',
checked = ' ',.
```
would display the same as before the modification.
@MeanderingProgrammer
Copy link
Owner

Hi, thanks for the PR!

I went about resolving this in a slightly different way in: 258da4b.

Rather than overlaying with spaces I applied a conceal on the list marker before a checkbox, that way the entire line shifts over and we avoid the gap between the checkbox and the text.

I originally didn't like that when a cursor enters a line the concealed text pops back up, but turns out there is another option called concealcursor which lets us keep text concealed even when the cursor is on the line. Needed to make window options more configurable to do this, but that might be useful to have in either case.

Hope this does what you were looking for, I appreciate your time!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants