Description
When using visual block mode to append text to lines with a wrong indentation, typing indentkeys causes the line being typed on to indent. This indent is not transferred to the other lines, instead part of the typed line is transferred to the other lines. I noticed this in Verilog files, did not look too much into other file types.
To Reproduce
vim --clean test.valways @()
12
34
<C-v> j A begin <esc> (include a space so begin is registered as a keyword)always @()
12 begin
34 12 begin
Expected behavior
Last line should look like
34 begin
Environment (please complete the following information):
VIM - Vi IMproved 8.2 (2019 Dec 12, compiled May 28 2021 06:58:52)
Included patches: 1-2891
Compiled by Arch Linux
Additional context
The minimal example is incorrect Verilog syntax. The reason I found this was because a plugin set ; as an indentkey.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or unsubscribe.![]()
Hm, Vim should abort block append once it notices that indenting kicked in. And it seems to do so for me with 8.2.3161
Could be it was patched already then. Apologies for taking up your time.
Closed #8659.
I don't know. What you can do is temporarily enable paste mode. Then block edit should work without indenting kicking in. BTW: For me I see the same behaviour on 8.2.2844 I see this:
always @()
12 begin
34
so Vim correctly stopped block append. This may not be the desired behaviour either, however. It just safely aborts because the indention may confuse Vim and lead to results you saw. I don't know why this would still happen, IIRC it should behave like that for a long time.