Is it possible to highlight part of text for a half a second

Base on how to set view stay in current position when cm.doc.setValue()

I’m updating the content and scroll into sample place. But it’s hard to spot what had change. So I want to create diff of old and new content, and highlight what had change.

I’m working on parser that generate JavaScript AST and sometimes the changes are so small that is hard to spot, but I don’t want to spend hours to write code that will update ranges. It work when I update whole content nad scroll into same place. But I just want to highlight what had changed.

I’ve figure out how to get the right diff, later. Right now I just want to know if you can mark part of the code in editor.

markText is probably what you need.