Highlighting "flickering" while applying formatting
jonkri opened this issue · 2 comments
prettier mode needs to request re-highlighting after changing the buffer. If you execute: M-x web-mode
when highlights are broken, it will fix the highlights. To do this automatically after prettier does its thing:
(eval-after-load 'web-mode
'(progn
(add-hook 'web-mode-hook #'add-node-modules-path)
(add-hook 'after-save-hook #'web-mode)
(add-hook 'web-mode-hook #'prettier-js-mode)))
Thanks for your suggestion, but my problem isn't that the highlight becames broken in a way that the code snippet above fixes. My problem is the "flickering". For a fraction of a second, all the text turns to the foreground color (after which the syntax highlighting is restored automatically, with or without the code snippet that you posted). I would like to avoid this "flickering", if possible, so that the code is always rendered using the correct syntax highlighting, during all milliseconds. 🙂
I hope that clarifies my problem!