mawww / kakoune

mawww's experiment for a better code editor
http://kakoune.org
The Unlicense
9.85k stars 710 forks source link

[BUG] dot ('.') command repeats too much text #5112

Open aghast opened 6 months ago

aghast commented 6 months ago

Version of Kakoune

unknown (but later than 20210828)

Reproducer

From bash prompt:

> kak test    # <-- no extension on file, so no filetype stuff

Within kak:

insert text: "foo(argtype arg)"
dupe 3 times:  xyppp
go back to top, cursor on ): gggl
insert text: "[const static 1]"
repeat for following lines: j.j.j.

Outcome

foo(argtype args[const static 1])
foo(argtype args[const static 1]])
foo(argtype args[const static 1]]])
foo(argtype args[const static 1]]]])

Expectations

foo(argtype args[const static 1])
foo(argtype args[const static 1])
foo(argtype args[const static 1])
foo(argtype args[const static 1])

Additional information

FWIW, if you have a macro line that ends with a bunch of tabs and a backslash ('\'), and you use . to paste in more endings, there is more than just a single character repeated. So I don't think this is "merely" an off-by-one error or something. It seems more likely to be multiple copies of the selection overlaying somehow?

OS is Debian 12.5

uname says

Linux laptop 6.1.0-17-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.69-1 (2023-12-30) x86_64 GNU/Linux

I ran kak -version and got "Kakoune unknown"

So I ran strings - /usr/bin/kak | grep '20[12]' and got:

assert failed "m_buffer.flags() & Buffer::Flags::Fifo" at buffer_utils.cc:201
 colored and curly underlines support (undocumented in 20210828)
2019-01-03
2019
assert failed "vm.exec("2019-01-03", RegexExecFlags::None)" at regex_impl.cc:1581
assert failed "StringView{vm.captures()[2], vm.captures()[3]} == "2019"" at regex_impl.cc:1582
0123456789abcdef00010203040506070809101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
00010203040506070809101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
[?2026$p
[?2026h
[?2026l

So I'm guessing my version is post 202108, but that's all I got.

schragge commented 5 months ago

Kakoune in Debian 12 repository is 2022.10.31. I can reproduce this neither with that version nor with 2023.08.05 nor with the git head. Could it somehow be related to #3600? That issue was recently fixed, and now I'm experiencing the very reverse problem: dot doesn't always repeat what it should. See #5122.