aserebryakov / filestyle

filestyle is a Vim plugin that highlights unwanted whitespace and characters.
http://www.vim.org/scripts/script.php?script_id=5065
Apache License 2.0
30 stars 5 forks source link

Define ctermbg parameter if cleared #43

Closed Juanitou closed 6 years ago

Juanitou commented 6 years ago

Hi!

I have an issue with a plain Vim configuration where only the Vundle and Filestyle plugins are installed. No other modification whatsoever.

When I start Vim (not gVim) I get the following error:

FileStyle: ctermbg parameter should be defined explicitly
Press ENTER or type command to continue

I don’t really understand why the ctermbg parameter is not set, but it seems expected with the default colorscheme:

:hi Normal
Normal           xxx cleared

This is on a FreeBSD virtual machine. I’ve tried with the plain CSH shell:

:echo &term
xterm

Same error within a tmux session:

:echo &term
screen

Anyway, the attached patch resolves the issue for me, but I would not be surprised if it broke another functionality, as this is quite over my head.

Hope it helps!

Juanitou commented 6 years ago

I forgot to add that before the patch, when entering Insert mode in Vim, I get the following errors:

Error detected while processing function FileStyleInsertModeEnter[8]..FileStyleIgnoreTrailingSpacesInCurrentLine:
line    2:
E28: No such highlight group name: FileStyleIgnoredPattern

…as well as similar errors when going back to Normal mode.

aserebryakov commented 6 years ago

@Juanitou thank you for proposed solution, but I decided to do something bit more generic. See the 5190b8b.