From b945a34173197c836cb6446637434afa3b05f99e Mon Sep 17 00:00:00 2001
From: Marijn Haverbeke <marijnh@gmail.com>
Date: Wed, 10 Dec 2014 17:41:52 +0100
Subject: [PATCH] Immediately read input on "input" event

To prevent race conditions where an API call triggers a
resetInput before the new input has been read.

Closes #2975
---
 lib/codemirror.js | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/codemirror.js b/lib/codemirror.js
index 4d0b12c4..151925f7 100644
--- a/lib/codemirror.js
+++ b/lib/codemirror.js
@@ -2660,7 +2660,7 @@
     on(d.input, "keyup", function(e) { onKeyUp.call(cm, e); });
     on(d.input, "input", function() {
       if (ie && ie_version >= 9 && cm.display.inputHasSelection) cm.display.inputHasSelection = null;
-      fastPoll(cm);
+      readInput(cm);
     });
     on(d.input, "keydown", operation(cm, onKeyDown));
     on(d.input, "keypress", operation(cm, onKeyPress));
-- 
GitLab