On Mo, 18 Aug 2014, Bram Moolenaar wrote:
> Christian Brabandt wrote:
> > > > I have found a breakindent bug.
It's actually not a breakindent bug. The breakindent feature just makes
it more apparent. I can reproduce the issue on a plain 7.4 version.
Looking at the mercurial repository, that particular code is present
since the beginning of version 7. So I suspect, even the first Vim 7
also had the same problem.
The problem is, the display is correct, but the underlying data is
wrong.
Attached is a patch including a test.
Best,
Christian
--
--
--
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php
---
You received this message because you are subscribed to the Google Groups
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.
diff --git a/src/charset.c b/src/charset.c
--- a/src/charset.c
+++ b/src/charset.c
@@ -1195,10 +1195,7 @@ win_lbr_chartabsize(wp, line, s, col, he
if (wp->w_p_bri)
added += get_breakindent_win(wp, line);
- if (tab_corr)
- size += (added / wp->w_buffer->b_p_ts) * wp->w_buffer->b_p_ts;
- else
- size += added;
+ size += added;
if (col != 0)
added = 0;
}
diff --git a/src/testdir/Make_amiga.mak b/src/testdir/Make_amiga.mak
--- a/src/testdir/Make_amiga.mak
+++ b/src/testdir/Make_amiga.mak
@@ -38,6 +38,7 @@ SCRIPTS = test1.out test3.out test4.out
test104.out test105.out test106.out test107.out \
test_autoformat_join.out \
test_breakindent.out \
+ test_breakindent_bug.out \
test_changelist.out \
test_eval.out \
test_insertcount.out \
diff --git a/src/testdir/Make_dos.mak b/src/testdir/Make_dos.mak
--- a/src/testdir/Make_dos.mak
+++ b/src/testdir/Make_dos.mak
@@ -37,6 +37,7 @@ SCRIPTS = test3.out test4.out test5.out
test105.out test106.out test107.out\
test_autoformat_join.out \
test_breakindent.out \
+ test_breakindent_bug.out \
test_changelist.out \
test_eval.out \
test_insertcount.out \
diff --git a/src/testdir/Make_ming.mak b/src/testdir/Make_ming.mak
--- a/src/testdir/Make_ming.mak
+++ b/src/testdir/Make_ming.mak
@@ -57,6 +57,7 @@ SCRIPTS = test3.out test4.out test5.out
test105.out test106.out test107.out \
test_autoformat_join.out \
test_breakindent.out \
+ test_breakindent_bug.out \
test_changelist.out \
test_eval.out \
test_insertcount.out \
diff --git a/src/testdir/Make_os2.mak b/src/testdir/Make_os2.mak
--- a/src/testdir/Make_os2.mak
+++ b/src/testdir/Make_os2.mak
@@ -39,6 +39,7 @@ SCRIPTS = test1.out test3.out test4.out
test105.out test106.out test107.out \
test_autoformat_join.out \
test_breakindent.out \
+ test_breakindent_bug.out \
test_changelist.out \
test_eval.out \
test_insertcount.out \
diff --git a/src/testdir/Make_vms.mms b/src/testdir/Make_vms.mms
--- a/src/testdir/Make_vms.mms
+++ b/src/testdir/Make_vms.mms
@@ -98,6 +98,7 @@ SCRIPT = test1.out test2.out test3.out
test105.out test106.out test107.out \
test_autoformat_join.out \
test_breakindent.out \
+ test_breakindent_bug.out \
test_changelist.out \
test_eval.out \
test_insertcount.out \
diff --git a/src/testdir/Makefile b/src/testdir/Makefile
--- a/src/testdir/Makefile
+++ b/src/testdir/Makefile
@@ -35,6 +35,7 @@ SCRIPTS = test1.out test2.out test3.out
test104.out test105.out test106.out test107.out \
test_autoformat_join.out \
test_breakindent.out \
+ test_breakindent_bug.out \
test_changelist.out \
test_eval.out \
test_insertcount.out \
diff --git a/src/testdir/test_breakindent_bug.in b/src/testdir/test_breakindent_bug.in
new file mode 100644
--- /dev/null
+++ b/src/testdir/test_breakindent_bug.in
@@ -0,0 +1,18 @@
+Test for breakindent
+
+STARTTEST
+:so small.vim
+:if !exists("+breakindent") | e! test.ok | w! test.out | qa! | endif
+:20vsp
+:set breakindent
+:/^\s*a
+fbgjyl
+:$put =@0
+:?^\s*z
+fygjyl
+:$put =@0
+:w! test.out
+:qa!
+ENDTEST
+ a b c d e
+ z y x w v
diff --git a/src/testdir/test_breakindent_bug.ok b/src/testdir/test_breakindent_bug.ok
new file mode 100644
--- /dev/null
+++ b/src/testdir/test_breakindent_bug.ok
@@ -0,0 +1,20 @@
+Test for breakindent
+
+STARTTEST
+:so small.vim
+:if !exists("+breakindent") | e! test.ok | w! test.out | qa! | endif
+:20vsp
+:set breakindent
+:/^\s*a
+fbgjyl
+:$put =@0
+:?^\s*z
+fygjyl
+:$put =@0
+:w! test.out
+:qa!
+ENDTEST
+ a b c d e
+ z y x w v
+d
+w