-
Notifications
You must be signed in to change notification settings - Fork 49
feature: Indent top-level unordered ("bulleted") list items #181
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
Comments
This works
except the wrapped portion of a line-wrapped list item now doesn't indent nicely so that its first character is horizontally aligned with the first character of the item. |
I'm not trying to render the markdown like github or any other specific software by default. The default is really my personal preference, which is to strike a balance between what I consider looking nice, without shifting the text too much, I more or less like an overlay. That's why all the indentation features are off / set to zero by default. From there it's up to individuals to set the configuration to their preference. I do have a notion of presets though: https://github.com/MeanderingProgrammer/render-markdown.nvim/blob/main/lua/render-markdown/presets.lua#L15, if you want to offer up a suggested config for It looks like you found the |
I ought to have found |
## Details Issue: #181 Currently list item padding only works in and around a bullet point which causes wrapped lines to be ignored and as a result they end up offset. To fix this we need to get the range of the parent list item and apply padding over its range. However the ranges of list items encompass all their children. This means a simple approach would stack the padding resulting in overly indented text. To deal with this we need to base our end row off of both the list item as well the start of the next list if one exist. There was also some prioritization and column handling that needed to happen to support good interp with indent blank lines. To make this work the starting column needed to be based off of the starting column of the top most list for the current item. Then the left padding needs a low priority to move indent blank lines marks whereas the right padding uses the default priority so it does not further skew these marks. As part of this change handling list markers was moved into its own handler class like we've done to many other components.
No worries, the configuration for this plugin is not easy to parse though. In general most components should support padding in some form or another. Applying padding to all lines of list items should work after: 3adb9d5. |
I updated with Lazy and its log now shows 3adb9d5 as the latest commit. I closed and re-opened an .md file that exhibited the wrap issue, but see no change. Is there something else I should do? |
I should add that the instances I am seeing are not really dynamically wrapped but are multiple-line items. However, the issue does occur with dynamically-wrapped items, e.g., when resizing a window. |
Ah I thought you were referring to manual line breaks in markdown files, but you're taking about actual wrapped lines. That's not something I can control in the plugin and is completely up to your neovim config for how line breaks are handled. Checkout:
Likely what you want is for me to be able to add padding to line breaks equal to the added padding around the bullet point. Unfortunately this is basically impossible. |
Ah gotcha, I wasn't sure how to describe the difference, maybe manually wrapped? Anyway, glad we were on the same page and the fix works for you! I imagine there can be many reasons for an update not being picked up immediately. I agree the new behavior is a much better way to handle padding list items. I think this might be a remanent from when I only handled the literal bullet point of list items. Thanks for brining up the issue! |
Is your feature request related to a problem? Please describe.
Unordered list items, e.g.,
should be rendered indented, should't they?
Describe the solution you'd like
--Using github's markdown rendering to show what I'd like; the pre-rendering hyphens are at the left margin
Describe alternatives you've considered
I don't know what other solutions or features to consider, given that I otherwise like render-markdown.nvim a lot.
Additional information
No response
The text was updated successfully, but these errors were encountered: