yasuyk / web-beautify

Format HTML, CSS and JavaScript/JSON by js-beautify
GNU General Public License v3.0
219 stars 21 forks source link

Highlighting "flickering" while applying formatting #41

Open jonkri opened 4 years ago

jonkri commented 4 years ago

Under some circumstances, lines lose their syntax highlighting for a while when formatting is applied.

The attached image illustrates it.

web-beautify

I would like for the text not to temporarily turn to the foreground color.

SpiderPig commented 8 months ago

This has to do with the way it applies the formatting. It could probably benefit from the way prettier-js and go-mode/gofmt work. They compute the differences and then apply the changes by spot patching the contents without rewriting the entire buffer. It also protects the undo history.