bronson / vim-trailing-whitespace

Highlights trailing whitespace in red and provides :FixWhitespace to fix it.
452 stars 62 forks source link

fix whitespace highlight bug #15

Closed jhyume closed 8 years ago

jhyume commented 8 years ago

Hi, bronson,

There may be a bug when using g:extra_whitespace_ignored_filetypes and vim split window. I find this bug when using Conque-GDB: another vim script for cpp debugging.

In short:

  1. It is better to match NOTHING(here I use ^^, which pattern will never occur) to ExtraWhitespace if ShouldMatchWhitespace() function returns 0. Otherwise ExtraWhitespace will not change in another split-vim-window.
  2. Only audocmd BufRead is not enough for my case. Here I add BufNew.

Otherwise, even if I added let g:extra_whitespace_ignored_filetypes = ['conque_term'], the vim looked like (see the red whitespace highlights in the below window): 2016-02-28 3 17 17

bronson commented 8 years ago

Good find. Thanks!