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.

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've also seen where I've been editing a file that gets textwidth set
locally via a FileType autocmd, and then switch to a file that leaves
the textwidth set to 0.  As with the above, the textwidth=0 file is
still showing the colorcolumn when it shouldn't.  Then I switch back
to the original buffer to find the colorcolumn missing, but textwidth
is still set to 80.  I suspect the bugs between the cases are related.

Let me know if there's something more that I can do to help.  I'm
still getting familiar with Vim's code base, or I'd be presenting a
patch right now. :-)

-John

-- 
-- 
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.


Raspunde prin e-mail lui