max397574/better-escape.nvim

check_characters() sometimes forgets to start_timeout()

Closed this issue · 0 comments

First Case

consider the case: we have custom mapping { 'jk', 'kj' }
if we consecutivly press jjk then we won't escape as expected.

explain in detail:

first_table = { 'j', 'k' }
second_table = { 'k', 'j' }

after pressing j, j, both of them are in first_table and second_table and the match will fail.
In this case we should start_timeout() because j is in first_table but we forgot.

Second Case

consider the case: we have custom mapping { 'jk', 'kj' }
we press j, wait 1sec then press kj, we wont escape as expected.

because after we failed at check_timeout() at 'k', we forgot to start_timeout() as 'k' is in first_chars