> I've been digging through the Vim source and had trouble trying to > 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. With 'linebreak' on the results are also impressive, though not always so 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 line 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 with 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 at least a week! Ben. Send instant messages to your online friends http://au.messenger.yahoo.com --~--~---------~--~----~------------~-------~--~----~ You received this message from the "vim_dev" maillist. For more information, visit http://www.vim.org/maillist.php -~----------~----~----~----~------~----~------~--~---
