diff --git a/lib/codemirror.js b/lib/codemirror.js
index <HASH>..<HASH> 100644
--- a/lib/codemirror.js
+++ b/lib/codemirror.js
@@ -1387,6 +1387,7 @@ var CodeMirror = (function() {
         line.highlight(mode, state);
         line.stateAfter = copyState(mode, state);
       }
+      changes.push({from: start, to: n});
       if (n < lines.length && !lines[n].stateAfter) work.push(n);
       return state;
     }
Make sure lines highlighted by getStateBefore are updated