Skip to content

feature: Checkbox-like highlights for bullet points #354

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
Asterikss opened this issue Mar 1, 2025 · 2 comments
Closed

feature: Checkbox-like highlights for bullet points #354

Asterikss opened this issue Mar 1, 2025 · 2 comments
Labels
enhancement New feature or request

Comments

@Asterikss
Copy link

Is your feature request related to a problem? Please describe.

I take notes almost exclusively in bullet points. It would be awesome if they received the same visual treatment as TODO items (checkboxes). Color distinction really goes a long way when they are nested, and would provide a nice touch visually, breaking the repetitiveness when dealing with long lists.

Describe the solution you'd like

With the current setup for checkboxes in mind:

checkbox = {
  -- ...
  custom = {
    uncertain = {
      rendered = 'ʕ•ᴥ•ʔ?',
      highlight = 'MyHighlight',
      scope_highlight = 'MyHighlight'
    },
  },
}

I would like to be able to customize bullets in a similar manner:

bullet = {
  icons = { '', '', '', '' },
  highlight = {'MyHighlight' , 'AnotherHighlight', 'X', 'Y'},
  scope_highlight = {'MyHighlight2' , 'A', 'B', 'C'},
}

So that each level could receive its own color for both the bullet point icon and its contents, just like with checkboxes.

Setting one highlight would cascade down, resulting in the same-looking highlight, as with the current one-highlight bullet setup (similarly to how the icons field works).

Describe alternatives you've considered

I imagine highlights would be indexed similarly to how icons are indexed, but maybe there is a better way.

Additional information

No response

@Asterikss Asterikss added the enhancement New feature or request label Mar 1, 2025
MeanderingProgrammer added a commit that referenced this issue Mar 3, 2025
## Details

Request: #354

Adds a `scope_highlight` parameter to the `bullet` configuration which
is used in the same way as the `checkbox` equivalent to highlight the item.

Also allows `highlight` to be the same type as `icons`, i.e. `string` |
`string[]` | `string[][]` | `function`. The support for a plain string
was added in this change as well to ensure backwards compatibility for
the `highlight` configuration.

Update documentation formatting and improve validation messages.
@MeanderingProgrammer
Copy link
Owner

Added this here: 9e3393b

highlight & scope_highlight support string, string[], string[][], or function as their type, so up to you which you provide. The example you gave should work.

@Asterikss
Copy link
Author

Awesome! Thank you!

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

No branches or pull requests

2 participants