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

Improve support for variable bullet lengths #93

Merged
merged 1 commit into from
Sep 3, 2024

Conversation

f4z3r
Copy link
Contributor

@f4z3r f4z3r commented Aug 31, 2024

I personally like to still have the number of bullets equal to the heading level to simpler overview on what level I am at. Before this PR, it was already possible to set more than one character for a bullet, but the virtual text was then misaligned. This PR allows to define several characters for the bullets ensuring they are correctly aligned as long as the character count is less or equal to the heading level on which they will be applied. Thus, configurations such as the following become possible and are properly aligned: https://github.com/f4z3r/nix/blob/3dfe0f2a28920f1598662c948b846651f551c4f3/home/apps/nvim/plugin/headlines.lua#L4

Existing configurations are not affected by the change.

Copy link
Owner

@lukas-reineke lukas-reineke left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, but string.len returns the byte length. This doesn't work correctly for UTF-8. Please use strwidth instead

@f4z3r
Copy link
Contributor Author

f4z3r commented Sep 3, 2024

@lukas-reineke ah good point! I updated the PR.

Copy link
Owner

@lukas-reineke lukas-reineke left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks

@lukas-reineke lukas-reineke merged commit 7671eec into lukas-reineke:master Sep 3, 2024
1 of 3 checks passed
@f4z3r f4z3r deleted the feat/bullet-len branch September 3, 2024 08:43
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.

2 participants