Closed konradmalik closed 1 year ago
Good catch. Just pushed a commit to fix. Pretty sure it was an off-by-one error.
fixed, thanks! buuut... there is another bug. Can open another issue if you want. Problem: not all boolean values cycle correctly. Some of them just switch once and that's it:
Check the latest version and please tell me if this solves your issues. I made the code a bit "trickier" to handle more edge cases.
just checked and the infinite loop came back, just for the boolean-like values. true/false, on/off, yes/no. 1,2,3 etc. works ok.
Ok, I changed some more things. Does the latest commit fix your issue?
I'm testing now and trying to handle more edge cases.
Alright, I think it's fixed. Let me know if you find any other bugs.
yeah, now works perfectly, thanks! This also fixed another minor thing I noticed before: the switch worked only if placed on the very first letter of the word. For example to switch 'on' to 'off' I needed to be at 'o' and I wasn't sure if it was a bug or feature 😅 but now it's perfect and works anywhere inside the word. Again thanks.
I am still experiencing this problem. It works well if I C-x
on top of something changable, but my nvim is stuck if I use it anywhere else.
I've seen that you also have a branch that is not released yet. I tried with both master & that branch.
Thanks for the report. Can you send an example file that shows this bug?
Input:
const a = "disabled";
const b = "hello there";
const c = "Sun";
Config:
use({
"nat-418/boole.nvim",
config = function()
require("boole").setup({
mappings = {
increment = "<C-a>",
decrement = "<C-x>",
},
allow_caps_additions = {
{ "enable", "disable" },
{ "enabled", "disabled" },
},
})
end,
})
C-x
or C-a
work as expected.C-x
or C-a
end up in an infinite loop.Input:
const a = "disabled"; const b = "hello there"; const c = "Sun";
Config:
use({ "nat-418/boole.nvim", config = function() require("boole").setup({ mappings = { increment = "<C-a>", decrement = "<C-x>", }, allow_caps_additions = { { "enable", "disable" }, { "enabled", "disabled" }, }, }) end, })
* If cursor in line 1, `C-x` or `C-a` work as expected. * If cursor in line 2, `C-x` or `C-a` end up in an infinite loop. * If cursor in line 3, they also work as expected.
Thanks for the report. Can you pull and test the fix I just pushed?
Hey, I started having problems with this plugin yesterday.
After upgrading this plugin via packer, neovim showed me a "breaking change" notice for bool, so I think its related to this commit: 49a1354ef0fd3bc23350cbbf3f8d9e7d11cab077.
Since then I cannot use either incrementing or decrementing. Seems like there is some kind of an infinite loop? Basically, the whole neovim instance freezes for a minute or so, sometimes it unfreezes after that, and sometimes all I can do is kill the process. It does not perform the operation in the end, so no increment or decrement.
Steps to reproduce:
This happens on my both machines, the newest macOS and Ubuntu 22.04. Neovim version is 0.8.0. Default boole config. Updated boole since then with your newest commits, same story.
Any ideas?