On Tue, February 5, 2013 10:42, John Szakmeister wrote: > Hello All, > > I believe I've discovered a bug in colorcolumn (and possibly > textwidth) handling in Vim. I discovered it a little while ago, but > only recently was able to spend some time and make sure that it wasn't > a problem I introduced somehow. > > I can trigger it by editing two files: A.txt and B.txt. Fire up gvim > with: > > gvim -u NONE -U NONE A.txt B.txt > > Next, run this series of commands: > > :setlocal tw=80 > :set colorcolumn=+1 > :buffer 2 > :set tw? > textwidth=0 > :set colorcolumn? > colorcolumn=+1 > > At this point, B.txt should be shown, but notice something: the > colorcolumn is present event though the textwidth is 0, but you still > see the colorcolumn which should be hidden. I believe this is the > first bug.
Hm, this is tricky, since 'tw' is local to the buffer, while 'colorcolumn' is local to the window and by the time colorcolumn is evaluated, it looks for the textwidth column of the current active buffer. It isn't re-evaluated the next time another buffer is loaded (and even then, it wouldn't be window-local anymore). So perhaps, we need to make 'colorcolumn' buffer-local. > > Now switch back to the first buffer: > > :buffer 1 > :set tw? > textwidth=0 > :set colorcolumn? > colorcolumn=+1 > > The colorcolumn is still present, but now textwidth is reporting back > 0 instead of 80--which seems like another bug. I don't see this. What Vim version is this? regards, 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/groups/opt_out.
