On So, 17 Aug 2014, Bram Moolenaar wrote:
>
> Christian Brabandt wrote:
>
> > Hi,
> > I have found a breakindent bug.
> >
> > Take the attached script and source it. Note, how the final d seems to be
> > further to the right, then expected. (It isn't even reachable, if you
> > press $ the cursor will stay before it, but pressing ga will show, that
> > you are actually on the correct location).
> >
> > The bug seems to be, that under certain conditions, an extra indent is
> > applied, although it isn't necessary.
> >
> > Here is a half-working patch that seems to fix it, but I am not sure,
> > this is the right way and also this doesn't work, if 'sbr' is set.
>
> Thanks, but I think I'll wait until you have a full-working patch :-).
Haha ;)
Okay, here we go:
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;
}
I am not entirely sure, about this and win_lbr_chartabsize is used in
many different places, so please review. I'll try to update
test_breakindent, but so far, I wasn't able to reproduce the issue
there.
Best,
Christian
--
Von den Gipfeln dieser Pyramiden blicken 40 Jahrhunderte auf uns
herab.
-- Napoleon I. Bonaparte