Cloudef / bemenu

Dynamic menu library and client program inspired by dmenu
GNU General Public License v3.0
1.19k stars 94 forks source link

In vim mode dw causes deadlock #414

Closed yuri-the-cockroach closed 1 month ago

yuri-the-cockroach commented 1 month ago

With vim bindings, in normal mode, if you try to do dw on the last(or only) word, you will get a dead-lock. The bemenu will freeze and won't do anything else. If there is at least a space after the word, it will work as intended.

oversoul commented 1 month ago

@yuri-the-cockroach as far as i can tell the issue comes from

https://github.com/Cloudef/bemenu/blob/master/lib/vim.c#L152

the filter_length should be updated on each iteration. deleting the character causes the filter value to change, but it compares against the old size.

i can make a pull request for this, if the maintainers think it's the right way to proceed.

Cloudef commented 1 month ago

That sounds like a correct solution. Feel free open a PR

oversoul commented 1 month ago

@Cloudef alright #419