Mercurial > vim
diff src/ops.c @ 26307:294736db2561 v8.2.3684
patch 8.2.3684: blockwise insert does not handle autoindent properly
Commit: https://github.com/vim/vim/commit/e9b0b40b7978f683977922233b42dd439ef31920
Author: Bram Moolenaar <Bram@vim.org>
Date: Sat Nov 27 13:28:24 2021 +0000
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 https://github.com/vim/vim/issues/9229)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Sat, 27 Nov 2021 14:30:03 +0100 |
parents | 9a8e9383e4cd |
children | 74e706afae3f |
line wrap: on
line diff
--- a/src/ops.c +++ b/src/ops.c @@ -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; }