chrisbra / Colorizer

color hex codes and color names
550 stars 31 forks source link

Problem with :ColorHighlight on init.vim file. #45

Closed ghost closed 8 years ago

ghost commented 8 years ago

Getting this on neovim 0.1.4 with 1587362323be72f172a7915bb6e7ba3fb18a1afb.

Colorizer: Some error occured here:  Colorize: ['^\s*\%(\%[Html]HiLink\s\+\w\+\s\+\w\+\)\|\(^\s*hi\%[ghlight]!\?\s\+\(clear\)\@!\S\+.*\)', function('<SNR>140_PreviewVimHighlight'), 'colorizer_vimhighlight', '&ft ==# "vim"', []]
Colorizer: Position: [0, 705, 1, 0]

And line 705 is:

highlight ExtraWhitespace guibg=#fb4934
chrisbra commented 8 years ago

Hi Kamil!

On Di, 03 Mai 2016, Kamil Winczek wrote:

Getting this on neovim 0.1.4 with 1587362323be72f172a7915bb6e7ba3fb18a1afb.

Colorizer: Some error occured here:  Colorize: ['^\s*\%(\%[Html]HiLink\s\+\w\+\s\+\w\+\)\|\(^\s*hi\%[ghlight]!\?\s\+\(clear\)\@!\S\+.*\)', function('<SNR>140_PreviewVimHighlight'), 'colorizer_vimhighlight', '&ft ==# "vim"', []]
Colorizer: Position: [0, 705, 1, 0]

And line 705 is:

highlight ExtraWhitespace guibg=#fb4934

Works on latest Vim. Can you test there please?

Also do you perhaps use term trucolor feature?

Best,

Christian

Geschichte der Wissenschaften: Der reale Teil sind die Phänomene, der ideale die Ansichten der Phänomene. -- Goethe, Maximen und Reflektionen, Nr. 1095

ghost commented 8 years ago

I do use truecolor, yes.

I can also confirm it works as expected in vim 7.4. Any chance of getting it fixed for nvim?

chrisbra commented 8 years ago

Am 2016-05-06 18:44, schrieb Kamil Winczek:

I do use truecolor, yes.

I can also confirm it works as expected in vim 7.4. Any chance of getting it fixed for nvim?

Sure, if we can reproduce it.

Try with a new file test.vim and copy the mentioned input line there. Before running the :ColorHighlight command, add a vim breakpoint at the s:PreviewVimHighlight function: :breakadd func *PreviewVimHighlight then call :ColorHighlight command and step through the function (see :h debug-mode) and once you see the error, please show me the output.

BTW: does it happen when not using truecolor mode?

ghost commented 8 years ago

Hey,

This is what I got:

Entering Debug mode.  Type "cont" to continue.
function Colorizer#DoColor[77]..<SNR>143_PreviewVimHighlight
line 3: let s:position = getpos('.')
>cont
Colorizer: Some error occured here:  Colorize: ['^\s*\%(\%[Html]HiLink\s\+\w\+\s\+\w\+\)\|\(^\s*hi\%[ghlight]!\?\s\+\(clear\)\@!\S\+.*\)', function('<SNR>143_PreviewVimHighlight'), 'colorizer_vimhighlight', '&ft ==# "vim"', []]
Press ENTER or type command to continue

Seems to be working fine when I comment out let $NVIM_TUI_ENABLE_TRUE_COLOR=1 and restart nvim.

chrisbra commented 8 years ago

Am 2016-05-09 14:52, schrieb Kamil Winczek:

Hey,

This is what I got:

Entering Debug mode. Type "cont" to continue. function Colorizer#DoColor[77]..143_PreviewVimHighlight line 3: let s:position = getpos('.')

cont Colorizer: Some error occured here: Colorize: ['^\s_\%(\%[Html]HiLink\s+\w+\s+\w+)|(^\s_hi\%[ghlight]!\?\s+(clear)\@!\S+.*)', function('143_PreviewVimHighlight'), 'colorizer_vimhighlight', '&ft ==# "vim"', []] Press ENTER or type command to continue

Seems to be working fine when I comment out let $NVIM_TUI_ENABLE_TRUE_COLOR=1 and restart nvim.

don't use cont, but use step, to single step the function please.