0
0
mirror of https://github.com/vim/vim.git synced 2025-09-25 03:54:15 -04:00

patch 8.2.3684: blockwise insert does not handle autoindent properly

Problem:    Blockwise insert does not handle autoindent properly.
Solution:   Adjust text column for indent. (closes #9229)
This commit is contained in:
Bram Moolenaar
2021-11-27 13:28:24 +00:00
parent 279d733dfb
commit e9b0b40b79
3 changed files with 33 additions and 0 deletions

View File

@@ -1627,6 +1627,10 @@ op_insert(oparg_T *oap, long count1)
--bd2.textlen;
}
bd.textcol = bd2.textcol;
if (did_indent && bd.textcol > ind_pre)
// If the insert was in the indent then include the indent
// change in the new text, otherwise don't.
bd.textcol += ind_post - ind_pre;
bd.textlen = bd2.textlen;
}