You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat: avoid inline text for checkboxes when possible
## Details
Request: #378
Previously checkboxes were rendered by concealing the underlying text
and inlining the icon as virtual text. This works but would mess with
the cursor positions while scrolling due to how neovim handles showing
and hiding inline virtual text.
To avoid this we now use information about the amount of space available
to us, i.e. the width of the text in square brackets compared to the
width of the icon we are rendering, to add more clever marks.
Only when the icon is larger than the space available do we do the same
thing as before and fully conceal + inline.
Otherwise we use overlay virtual text to show the icon and conceal any
underlying text that extends under the icon (if any). When doing this we
also take into account the new `checkbox.right_pad` option (default
value 1), and similarly attempt to use the space available for the
padding. If the padding extends outside the available space then the
remaining amount is added as inline virtual text, requires neovim >=
`0.10.0` to work. The default value of 1 is chosen so that the rendered
text looks identical in most cases to before, since we now treat the
space after the checkbox as space available to us.
### Related Impacts
To maintain parity with how checked and unchecked checkboxes are handled
by `markdown`, we now require that there is a space following custom
states. This allows us to better determine exactly how much space we
have to work with.
The `checkbox.position` configuration option was removed. We now infer
how to display checkboxes best based on the space available to us and
the icon we are about to show. Any potential differences in how things
are displayed, can likely be changed back by using the new
`checkbox.right_pad` option. Most users should not see any differences.
Any users of `checkbox.position` should simply remove it from their
configuration, keeping it is fine, it just doesn't do anything.
Custom checkbox states will now work for versions of neovim older than
`0.10.0`, but since the plugin as a whole still requires `0.9.0` at a
minimum this only adds a couple supported versions for that specific
feature, and there are some limitations to its usage.
0 commit comments