summaryrefslogtreecommitdiffstats
path: root/src/edit.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2020-01-03 21:25:59 +0100
committerBram Moolenaar <Bram@vim.org>2020-01-03 21:25:59 +0100
commit5cb0b93d52fa5c12ca50a18509947ee6459bb7a8 (patch)
treea3da122f800028706adcfadb3c28ec6e371b1e2f /src/edit.c
parentf10997a1543eb0724d882da3678bacd44e647141 (diff)
patch 8.2.0083: text properties wrong when tabs and spaces are exchangedv8.2.0083
Problem: Text properties wrong when tabs and spaces are exchanged. Solution: Take text properties into account. (Nobuhiro Takasaki, closes #5427)
Diffstat (limited to 'src/edit.c')
-rw-r--r--src/edit.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/src/edit.c b/src/edit.c
index c67f67cb39..d2e45dd2f0 100644
--- a/src/edit.c
+++ b/src/edit.c
@@ -5601,14 +5601,20 @@ ins_tab(void)
i = cursor->col - fpos.col;
if (i > 0)
{
- STRMOVE(ptr, ptr + i);
+#ifdef FEAT_PROP_POPUP
+ if (!(State & VREPLACE_FLAG))
+ {
+ mch_memmove(ptr, ptr + i, curbuf->b_ml.ml_line_len - i
+ - (ptr - curbuf->b_ml.ml_line_ptr));
+ curbuf->b_ml.ml_line_len -= i;
+ }
+ else
+#endif
+ STRMOVE(ptr, ptr + i);
// correct replace stack.
if ((State & REPLACE_FLAG) && !(State & VREPLACE_FLAG))
for (temp = i; --temp >= 0; )
replace_join(repl_off);
-#ifdef FEAT_PROP_POPUP
- curbuf->b_ml.ml_line_len -= i;
-#endif
}
#ifdef FEAT_NETBEANS_INTG
if (netbeans_active())