Closed Aryailia closed 2 years ago
Thank you for reporting this.
the highlighting of vim-color-css seems to not be affected, at least at first glance.
It will indeed not be affected. Only performance might, in very bloated files.
I’m not sure what’s going on as ⓐ I don’t think I can reproduce the error despite using Vim 9 as my daily driver (but only 9.0.0065; who knows if that’s relevant) and ⓑ there’s quite a bit going on in that line but the error does not obviously seem connected to any of it, and so the change you made does not obviously look like it should fix it.
Does opening an empty HTML/Markdown file throw the error too?
If you are willing to help me narrow this down, can you try this line instead and tell me if that also triggers the error?
call filter( range( line('w0'), line('w$') ), 'substitute( getline(v:val), b:css_color_pat, ''\=s:create_syn_match()'', ''g'' )' )
I went about recreating a clean vim config environment to test this issue, and the issues magically disappeared. I deleted my vim directory and checking it out again from my dotfiles repo seems to have fixed it magically. So I guess either I made a mistake the first time around, or an update (though my vim version didn't change), or something tweaking a long the way fixed something.
So uhh... sorry for crying wolf.
No worries, happens to all of us. 🙂 Thanks for going to the trouble of trying to reproduce the issue cleanly, even if the outcome was that it just up and disappeared (sort of an inverse of the stages of debugging I guess (“how did that ever not work?”)). I’d rather err on the side of the occasional false positive than an occasional real issue going unreported, even if it means wasting a few minutes.
I am also having this same issue with markdown files.
I ran your debug line from the comment above in command mode and as a vimscript and got
E120: Using <SID> not in a script context: s:create_syn_match
As a vimscript
:so debug.vim
Error detected while processing /Users/whoami/code/team-utils/debug.vim:
line 1:
E117: Unknown function: s:create_syn_match
Press ENTER or type command to continue
I won't pretend to be a vimscript expert, and I'm pretty swamped to understand loading files today but I can run further debugging if you need.
And to answer your other question about it happening in an empty md
file, yes. It still happens. Seems to be just any md
filetype. However, it isn't happening on html
files like the original issue message.
When opening HTML or markdown files without anything that vim-css-color would normally color, I get the following error at startup:
This doesn't seem to affect anything other than displaying an error message at vim startup. This happens on files with content and with new files, the problem seeming to be the lack of a highlightable color. This error also occurs with a fresh .vimrc, VimPlug,
set nocompatible
,filetype plugin indent on
. This seems to be an issue that has only popped up as of vim9 (vim-9.0.0135). Running the my full vim setup in a docker container that has vim8 seems to not run into this issue.As soon as I save something like
<div color="#AA0000">
and reopen the file, vim no longer displays the error.I narrowed this down to the as being caused by the commit d70f5fb0b57ad85309347607b4f15f3371361cf4 . Reverting the line as displayed below does indeed resolve it, and the highlighting of vim-color-css seems to not be affected, at least at first glance.