Closed FrancisMurillo closed 1 year ago
it's colorized after color-identifiers:refresh
, but not immediately
I think js2-mode sometimes removes the face from comments briefly, causing color-identifiers:scan-identifiers
to think the words are valid candidate identifiers.
The right fix is to have two modes for scanning identifiers, one for identifier discovery and another for actually coloring. In the discovery mode, only candidates already fontified with with font-lock-variable-name-face or js2-function-param should be considered. In the coloring mode, unfontified text should also be considered.
This is caused by https://github.com/mooz/js2-mode/issues/450
@bennofs please give a test to #93. That fixes the problem for me, however as I don't code in JS myself, I can't see offhand if that doesn't cause unwanted side-effects. It should not though, and in my testing everything seem to look okay.
Oh, sorry, the report was opened by @FrancisMurillo. So, anyway, please see if the PR fixes the problem, it's really just a two line change which can even be stored in .emacs
file.
So, yeah, just to be clear: to test it you can simply paste the two added lines into your .emacs
file, should work just fine.
Huh, actually, the commit Don't go to (point-min) just to immediately relocate to property-change
from this PR fixes that for me as well o.O Who would have thought…
Now that I think of that, the reason is probably that when buffer has no font-locks, the (next-property-change (point))
will return nil
, so the complete function is basically skipped.
Huh, actually, the commit
Don't go to (point-min) just to immediately relocate to property-change
from this PR fixes that for me as well o.O Who would have thought…
Nvm, I dropped the change from that commit for now. I don't fully understand why (scan-identifiers)
works the way it does, so am afraid it might break something. Not gonna touch it for now.
Is it correct that comments are also colorized?
Great package by the way, helps me see the variables better.