markdown-mode icon indicating copy to clipboard operation
markdown-mode copied to clipboard

Out-of-sync JIT-lock

Open dabrahams opened this issue 6 years ago • 2 comments

When I stop typing, I often find that font lock changes faces incorrectly in text that follows the insertion point, as though it's reapplying the same styles at the old (pre-typing) character offsets.

Expected Behavior

If the syntactic role of following text is unchanged, JIT-font-lock should be idempotent, i.e. I should observe no change

Actual Behavior

Change is observed

Steps to Reproduce

With emacs -Q,

  1. open the attached file
  2. go to the end of line 439, and
  3. type quickly
  4. Then stop typing.

Software Versions

  • Markdown Mode: 2.4-dev from 20180124.138 (melpa)
  • Emacs: GNU Emacs 25.3.3 (x86_64-apple-darwin13.4.0, Carbon Version 157 AppKit 1265.21) of 2017-09-28
  • OS: macOS High Sierra

x.md.txt

dabrahams avatar May 13 '18 15:05 dabrahams

Bump. This makes what used to be a wonderful experience, writing in markdown-mode, really miserable. I love your mode! Please make it work (again)

dabrahams avatar May 15 '18 14:05 dabrahams

Thanks for reporting this and for the nice test case. I've identified and reverted the offending commit. Indeed, it was an attempt to improve performance by reusing cached text properties. I'll dig a little deeper to see what went wrong, but for now I've just reverted it.

jrblevin avatar Jun 19 '18 17:06 jrblevin