mirror of
https://github.com/neovim/neovim.git
synced 2025-09-14 07:18:17 +00:00
Correctly splice extmarks on tab with noexpandtab set
This commit is contained in:
@@ -8764,6 +8764,10 @@ static bool ins_tab(void)
|
||||
getvcol(curwin, &fpos, &vcol, NULL, NULL);
|
||||
getvcol(curwin, cursor, &want_vcol, NULL, NULL);
|
||||
|
||||
// save start of changed region for extmark_splice
|
||||
int start_row = fpos.lnum;
|
||||
colnr_T start_col = fpos.col;
|
||||
|
||||
// Use as many TABs as possible. Beware of 'breakindent', 'showbreak'
|
||||
// and 'linebreak' adding extra virtual columns.
|
||||
while (ascii_iswhite(*ptr)) {
|
||||
@@ -8813,6 +8817,11 @@ static bool ins_tab(void)
|
||||
replace_join(repl_off);
|
||||
}
|
||||
}
|
||||
if (!(State & VREPLACE_FLAG)) {
|
||||
extmark_splice_cols(curbuf, start_row - 1, start_col,
|
||||
cursor->col - start_col, fpos.col - start_col,
|
||||
kExtmarkUndo);
|
||||
}
|
||||
}
|
||||
cursor->col -= i;
|
||||
|
||||
|
Reference in New Issue
Block a user