alexherbo2 / auto-pairs.kak

Auto-pairing of characters for Kakoune
https://kakoune.org
77 stars 18 forks source link

backspace merges contiguous selections during append #29

Closed FlyingWombat closed 5 years ago

FlyingWombat commented 5 years ago

Regression of mawww/kakoune#2861

as of
Kakoune git: 1ebea85e6f07aeb6a8287b8043480f56f0e58edb
auto-pairs.kak git: 1f11e6f67846637885bc879e16a9873781be733b

andreyorst commented 5 years ago

So this plugin also causes the same problem as in https://github.com/andreyorst/smarttab.kak/issues/8?

FlyingWombat commented 5 years ago

Yes, from my testing, they both independently regress the issue.

It happens with:

kak -n -e "source ~/.local/share/kak/plugins/auto-pairs.kak/rc/auto-pairs.kak; auto-pairs-enable"
FlyingWombat commented 5 years ago

Here are the execute-keys tests I ran for reproducing the bug with auto-pairs.kak. The same as with https://github.com/andreyorst/smarttab.kak/issues/8, <space> is a key factor.

Two separate selections (as it should be):

kak -n -e "source '~/.local/share/kak/plugins/auto-pairs.kak/rc/auto-pairs.kak'; auto-pairs-enable; execute-keys -with-hooks '%di<space><space><esc>ggLs.<ret>atext<backspace>'"

One merged selection (bug):

kak -n -e "source '~/.local/share/kak/plugins/auto-pairs.kak/rc/auto-pairs.kak'; auto-pairs-enable; execute-keys -with-hooks '%di<space><space><esc>ggLs.<ret>atext<space><backspace>'"
andreyorst commented 5 years ago

Just making a note here that a no-plugin recipe was found, and perhaps this plugin has nothing to do with the issue described in original post.

FlyingWombat commented 5 years ago

The problem is related to Insert* hooks (such as auto-pairs-delete-space), and whether or not merging selections should be allowed in them.
So, it looks like the solution will need to be done upstream.

Closing this issue.