Mercurial > vim
comparison 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 |
comparison
equal
deleted
inserted
replaced
26306:f2bc5e27cd82 | 26307:294736db2561 |
---|---|
1625 pre_textlen += bd2.textlen - bd.textlen; | 1625 pre_textlen += bd2.textlen - bd.textlen; |
1626 if (bd2.endspaces) | 1626 if (bd2.endspaces) |
1627 --bd2.textlen; | 1627 --bd2.textlen; |
1628 } | 1628 } |
1629 bd.textcol = bd2.textcol; | 1629 bd.textcol = bd2.textcol; |
1630 if (did_indent && bd.textcol > ind_pre) | |
1631 // If the insert was in the indent then include the indent | |
1632 // change in the new text, otherwise don't. | |
1633 bd.textcol += ind_post - ind_pre; | |
1630 bd.textlen = bd2.textlen; | 1634 bd.textlen = bd2.textlen; |
1631 } | 1635 } |
1632 | 1636 |
1633 /* | 1637 /* |
1634 * Subsequent calls to ml_get() flush the firstline data - take a | 1638 * Subsequent calls to ml_get() flush the firstline data - take a |