mirror of
https://github.com/inkarkat/vim-ShowTrailingWhitespace.git
synced 2026-09-29 13:12:29 +02:00
The plugin links to the existing Error highlight group, assuming that this employs a (often red) background color. Some colorschemes (e.g. "koehler") only define a foreground color, though. That is of no use for the plugin's use case, though, because the trailing whitespace has no foreground, so only a background color can be used here. (Well, with :set list and 'listchars' having a "space" or "trail" setting, there would be some foreground to highlight, but it would be flimsy and the setting usually is off.) To address this issue, we need to build in some intelligence: If the ShowTrailingWhitespace highlight group is not linked to another, the user has defined their own colors, and we expect them to know what they're doing. If it is linked, check for the existence of a background color (considering the "reverse" attribute, and that the background color may be equal to the default background, but explicitly set). If there's no effective background coloring, fall back to using the foreground color instead.
12 lines
440 B
Plaintext
12 lines
440 B
Plaintext
autoload/ShowTrailingWhitespace.vim
|
|
autoload/ShowTrailingWhitespace/Color.vim
|
|
autoload/ShowTrailingWhitespace/Filter.vim
|
|
plugin/ShowTrailingWhitespace.vim
|
|
ftplugin/diff_ShowTrailingWhitespace.vim
|
|
ftplugin/dosbatch_ShowTrailingWhitespace.vim
|
|
ftplugin/mail_ShowTrailingWhitespace.vim
|
|
ftplugin/markdown_ShowTrailingWhitespace.vim
|
|
ftplugin/unite_ShowTrailingWhitespace.vim
|
|
ftplugin/xxd_ShowTrailingWhitespace.vim
|
|
doc/ShowTrailingWhitespace.txt
|