48069Re: Bug in win_lbr_chartabsize()?
- Oct 1, 2007On Mon, 01 Oct 2007 11:39:47 +1000, Ben Schmidt
> > I've been digging through the Vim source and had trouble trying toI don't think there's anywhere else where tabs and showbreak interact
> > understand what win_lbr_chartabsize() is doing. About 112 lines from
> > the start of the function (in 7.1.94) there's a part that should take
> > the width of a tab into account when used in combination with
> > "showbreak". I couldn't work out how these parts were supposed to
> > interact from studying the code so I tried studying Vim's behaviour
> > instead. The results are a bit odd.
> > Create a file with a line containing a repeating pattern of four
> > letters and a tab (that is, "abcd<tab>abcd<tab>abcd<tab>...") to a
> > width of about 300 columns. Then set wrap, showbreak=>>> and tabstop
> > to something like 9 so there aren't a even number of tabs in your
> > screen width or your screen width less the width of the showbreak.
> > Now, starting from the beginning of the line, press w repeatedly
> > and watch where the cursor goes after each movement. On some of the
> > wrapped lines I see it settle three characters to the left of where it
> > should be when it moves to the first word on each wrapped screen line.
> > I've tried to fix it, but no matter what I change the cursor always
> > lands in the wrong place at some point. Does anyone else see this?
> I see it. There is definitely something wrong here. I doubt it's just in that one
> function you mention, though.
in that way. There are other character size functions but I think they
all treat the line as if it were unbroken.
I was inspired to look at this by the thread on non-uniform tabstops
a month ago, as that's something I'd often find useful and I'm out of
work at the moment so I have some free time. Different column widths
for tabs isn't all that hard to implement (in that it melts only half
your brain instead of all of it), but this one place didn't seem to
> With 'linebreak' on the results are also impressive, though not always soI noticed that too, but I couldn't reproduce it reliably.
> impressive--after a few lines wrapping does not occur properly, but words are
> broken, and when moving through them with 'w' in some circumstances at the
> beginning of a line the cursor stops 'between' words!
> In both cases the cursor won't actually move to the end of the logical lineI didn't notice that. I didn't try $.
> either, i.e. push $ and the cursor will be put near, but not at the end!
> Is there a reason for not making the tabs work properly on wrapped lines withThat's what I'd have expected.
> showbreak? Is it too difficult to implement? I would've expected all the tabstops
> and everything else to be pushed backward by the 'showbreak' string as well.
> If I have some time, I'll have a look at this, but don't expect I will for atI'm going to be looking at it too. It's bugging me, not knowing what's
> least a week!
You received this message from the "vim_dev" maillist.
For more information, visit http://www.vim.org/maillist.php
- << Previous post in topic Next post in topic >>