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

Not incrementing correct "word" #24

Open
ErikReider opened this issue Jan 26, 2023 · 2 comments
Open

Not incrementing correct "word" #24

ErikReider opened this issue Jan 26, 2023 · 2 comments

Comments

@ErikReider
Copy link

Adding - [x] on to an empty file and trying to increment [x] increments on instead of toggling [x].

I tried adding this to the setup to be able to toggle markdown checkboxes but it didn't work :/

{"[ ]", "[x]"},
{"-[ ]", "-[x]"},
{"- [ ]", "- [x]"},
{"- []", "- [x]"},

Any idea on why this is happening?

@nat-418
Copy link
Owner

nat-418 commented Jan 26, 2023

Pretty sure this has to do with how vim/neovim measure words. I will test later and see what I can do. Thanks for the report.

@kaldyr
Copy link

kaldyr commented Nov 30, 2024

I believe the issue isn't that it's incrementing the wrong word, but rather that for some reason it's not recognizing the [ or ] characters correctly. If you don't put any other words that boole.nvim checks for on the line it just fails to do anything.

- [ ] This is a test Nothing happens.

On another note, if you put multiple words that boole.nvim is looking for on the same line it will always choose the last word that is configured to cycle on the line. So even if it did correctly see '- [x]', it would not cycle it because only the last match on the line gets cycled.

Testing enable testing yes testing true Chooses 'true'->'false' no matter where the cursor is on the line with the following .setup()

boole.setup({

	mappings = {
		increment = '<C-a>',
		decrement = '<C-x>',
	},

	additions = {
		{ '[ ]', '[x]' },
		{ '-[ ]', '-[x]'},
		{ '- [ ]', '- [x]'},
	},

	allow_caps_additions = {
		{ 'enable', 'disable' },
		{ 'true', 'false' },
		{ 'yes', 'no' },
		{ 'on', 'off' },
		{ 'before', 'after' },
	}

})

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

No branches or pull requests

3 participants