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(concealer)!: simpler config for ordered list icon & multichar icon for unordered list #1179

Merged
merged 14 commits into from
Feb 22, 2024

Conversation

champignoom
Copy link
Contributor

@champignoom champignoom commented Nov 22, 2023

One can now configure the icon of ordered lists simply with a sample string that represents the iconf for index 1. The icons for the rest of indices will be calculated automatically.

For example:

["core.concealer"] = {
    config = {
        icons = {
            ordered = {
                icons = { "item 1.", "[0]", "A.", "a.", "§ 1)", "I.", "i.", "", "", "", "" },
            },
        },
    },
},

the icons will be

  • item 1., item 2., ... for level 1
  • [0], [1], ... for level 2
  • A., B., ..., Z., AA., AB., ... for level 3
  • a., b., ..., z., aa., ab., ... for level 4
  • § 1), § 2), ... for level 5
  • I., II., III., IV., V., ..., MMMCMXCIX. for level 6
  • i., ii., iii., iv., v., ..., mmmcmxcix. for level 7
  • , , , ..., for level 8
  • etc

===EDIT===

Now unorderd list also supports multichar inline icon just as ordered list, for example:

["core.concealer"] = {
    config = {
        icons = {
            list= {
                icons = { "*", " +", "  -", "   >" },
            },
        },
    },
},

This emulates indentation=2 for the first four levels of unordered list:

* level-1
  + level-2 (indent=2)
    - level-3 (indent=4)
      > level-4 (indent=6)
       > level-5 (indent=7)
        > level-6 (indent=8)

So this PR should partially resolve #569.

@champignoom champignoom changed the title Concealer ordered format feat(concealer): simpler config for ordered list icon & multichar icon for unorderd list Nov 22, 2023
@champignoom champignoom force-pushed the concealer-ordered-format branch from 158f918 to b265c56 Compare November 26, 2023 19:03
@vhyrro
Copy link
Member

vhyrro commented Jan 6, 2024

Are we sure doing calculations like these aren't performance intensive? If it's still fast then I think we can go with this configuration approach, sure 👍

Also if you could fix the conflict please that would be great :P

@champignoom
Copy link
Contributor Author

Are we sure doing calculations like these aren't performance intensive?

No, it calculates and memoizes the format string only once.

Also if you could fix the conflict please that would be great :P

Done.

@vhyrro vhyrro changed the title feat(concealer): simpler config for ordered list icon & multichar icon for unorderd list feat(concealer)!: simpler config for ordered list icon & multichar icon for unordered list Feb 22, 2024
@vhyrro vhyrro merged commit da74d14 into nvim-neorg:main Feb 22, 2024
0 of 2 checks passed
sahinf pushed a commit to sahinf/neorg that referenced this pull request May 15, 2024
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.

Nested list icons
2 participants