mirror of
https://github.com/neovim/neovim
synced 2025-07-16 17:21:49 +00:00
vim-patch:8.2.0083: text properties wrong when tabs and spaces are exchanged
Problem: Text properties wrong when tabs and spaces are exchanged. Solution: Take text properties into account. (Nobuhiro Takasaki, closes vim/vim#5427)5cb0b93d52
Co-authored-by: Bram Moolenaar <Bram@vim.org> (cherry picked from commit4374ec83cd
)
This commit is contained in:
committed by
github-actions[bot]
parent
4c53b9c0a1
commit
704d33634e
@ -4419,18 +4419,21 @@ static bool ins_tab(void)
|
|||||||
// Delete following spaces.
|
// Delete following spaces.
|
||||||
int i = cursor->col - fpos.col;
|
int i = cursor->col - fpos.col;
|
||||||
if (i > 0) {
|
if (i > 0) {
|
||||||
|
if (!(State & VREPLACE_FLAG)) {
|
||||||
|
memmove(ptr, ptr + i, (size_t)(curbuf->b_ml.ml_line_len - i
|
||||||
|
- (ptr - curbuf->b_ml.ml_line_ptr)));
|
||||||
|
curbuf->b_ml.ml_line_len -= i;
|
||||||
|
inserted_bytes(fpos.lnum, change_col,
|
||||||
|
cursor->col - change_col, fpos.col - change_col);
|
||||||
|
} else {
|
||||||
STRMOVE(ptr, ptr + i);
|
STRMOVE(ptr, ptr + i);
|
||||||
|
}
|
||||||
// correct replace stack.
|
// correct replace stack.
|
||||||
if ((State & REPLACE_FLAG) && !(State & VREPLACE_FLAG)) {
|
if ((State & REPLACE_FLAG) && !(State & VREPLACE_FLAG)) {
|
||||||
for (temp = i; --temp >= 0;) {
|
for (temp = i; --temp >= 0;) {
|
||||||
replace_join(repl_off);
|
replace_join(repl_off);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!(State & VREPLACE_FLAG)) {
|
|
||||||
curbuf->b_ml.ml_line_len -= i;
|
|
||||||
inserted_bytes(fpos.lnum, change_col,
|
|
||||||
cursor->col - change_col, fpos.col - change_col);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
cursor->col -= i;
|
cursor->col -= i;
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user