From bcb51f2b2a2ba2e1f30ebf543d97e7450574763f Mon Sep 17 00:00:00 2001 From: Andrew Nester Date: Wed, 29 Jun 2022 16:29:00 +0200 Subject: [PATCH] fix: Move session.onChange and placeholder.onChange handlers to be first in the change event handler queue --- lib/ace/edit_session.js | 2 +- lib/ace/placeholder.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/ace/edit_session.js b/lib/ace/edit_session.js index eabc89ac667..0202745edc1 100644 --- a/lib/ace/edit_session.js +++ b/lib/ace/edit_session.js @@ -197,7 +197,7 @@ EditSession.$uid = 0; this.doc.off("change", this.$onChange); this.doc = doc; - doc.on("change", this.$onChange); + doc.on("change", this.$onChange, true); this.bgTokenizer.setDocument(this.getDocument()); diff --git a/lib/ace/placeholder.js b/lib/ace/placeholder.js index 96eb36bfc00..34090a8b913 100644 --- a/lib/ace/placeholder.js +++ b/lib/ace/placeholder.js @@ -58,7 +58,7 @@ var PlaceHolder = function(session, length, pos, others, mainClass, othersClass) this.mainClass = mainClass; this.othersClass = othersClass; this.$onUpdate = this.onUpdate.bind(this); - this.doc.on("change", this.$onUpdate); + this.doc.on("change", this.$onUpdate, true); this.$others = others; this.$onCursorChange = function() {