Skip to content
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

feat: configurable orderd list icons #1548

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

benlubas
Copy link
Contributor

@benlubas benlubas commented Aug 2, 2024

Allow the user to configure ordered list icons.

ex:

["core.concealer"] = {
  config = {
    ordered_icons = {
      ["1"] = function(i)
        if i < 10 then
          return "0" .. i
        end
        return tostring(i)
      end,
    },
  },
},

Yields:
image


This partially addresses a small issue where ordered lists that exceed 9 items in length, will not line up (b/c 10 is a char longer than 1). This allows people to pad single digits, but the padding will always be present.

Ideally the function above could take an index but also some context that includes the length of the list it's a part of. But this would require a more complex change

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.

1 participant