-
Notifications
You must be signed in to change notification settings - Fork 44
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
feature: inline checkbox position #140
Labels
enhancement
New feature or request
Comments
MeanderingProgrammer
added a commit
that referenced
this issue
Aug 20, 2024
# Details Submitted as a bug: #140 When checkboxes are rendered they are padded with spaces to fill the width of the underlying text. This is because most icons have a width of 2, while the text forming the checkbox (like [x]) has a width of 3. If spaces were not added using overlay virtual text would result in one of the square brackets poking through depending on the side of the padding. We can use inline virtual text which was added in neovim 0.10.0 to fully hide the underlying text and insert the virtual text, shifting text as needed, however on its own this would remove the feature for users of older versions of neovim. To get around this I have added a position property to the checkbox config which defaults to the new value of 'inline' which results in nicer alignment of checkboxes. The value 'overlay' is available and will result in identical behavior to before this change if users prefer it. Additionally when initializing the config we check the neovim version and change configuration values that are known to not work with older versions to availble alternatives. Currently this is done for: - checkbox position -> 'overlay' so as not to remove the feature and require users to manually modify their config if they run neovim < 0.10.0 - code position -> 'right' since left alignment requires shifting text while right does not, adding a feature to users if they did not dive too deep into the options available for this plugin Overall this updates behavior for anyone that can use it and keeps the old behavior around either out of necessity (version) or personal preference.
Not a bug. The additional spaces were needed to allow Added this as a new position property for checkboxes here: 275f289. The new |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Neovim version (nvim -v)
NVIM v0.10.0
Operating system
Ubuntu 22.04
Terminal emulator / GUI
Terminal
Describe the bug
A checkbox should have the same indentation level as the indentation level of the bullet point it is attached to.
Expected behavior
This code:
Generates this:
![image](https://private-user-images.githubusercontent.com/13114475/359295754-05252be1-b586-4133-8a4f-359edf2ee013.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzk4Nzc5NDQsIm5iZiI6MTczOTg3NzY0NCwicGF0aCI6Ii8xMzExNDQ3NS8zNTkyOTU3NTQtMDUyNTJiZTEtYjU4Ni00MTMzLThhNGYtMzU5ZWRmMmVlMDEzLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMTglMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjE4VDExMjA0NFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTA2YzUyYWM1NjUwOWUzNjc0OWM0MDZhNGJhYTVkZDFjZDExYmJmNTI5MWMwMGVlZmM2ZjZlYzcwYjM4NzM0MjkmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.LHOIhU1BCoSv-uSx5qwGs_j5eS2dvtAi229sfYJnYKU)
By looking at the code you would expect the checkbox to be at the same alignment as the bullet points, but it is further indented giving the impression that it is an item in a sublist.
Healthcheck output
render-markdown: require("render-markdown.health").check()
render-markdown.nvim [version] ~
render-markdown.nvim [configuration] ~
render-markdown.nvim [nvim-treesitter] ~
render-markdown.nvim [executables] ~
render-markdown.nvim [conflicts] ~
Plugin configuration
Default for Lazy.vim
Plugin error log
N/A
Confirmations
Additional information
No response
The text was updated successfully, but these errors were encountered: