ap / vim-css-color

Preview colours in source code while editing
http://www.vim.org/scripts/script.php?script_id=5056
MIT License
1.77k stars 78 forks source link

Error when writing an invalid RGB color #151

Open Aster89 opened 3 years ago

Aster89 commented 3 years ago

It happened as a typo that I wrote

  background-color: rgb(100,100,256);

and I got this error

Error detected while processing CursorMoved Autocommands for "<buffer=1>"..function <SNR>88_parse_screen[4]..<SNR>88_create_syn_match[34]..<SNR>88_create_highlight:                                                                                    
line    6:
E254: Cannot allocate colour #6464100
Press ENTER or type command to continue

I understand the reason of the error, but is it intended that the plugin actually errors out (allowing a multiple lines error that pushes the whole screen up) rather than just echoing a short message and giving up on coloring the color string?

ap commented 3 years ago

It’s missing an overflow check.