From 018390c8ee92a5671b54c9e5bf13b930cff8a90b Mon Sep 17 00:00:00 2001 From: Ian Storm Taylor Date: Wed, 10 Aug 2016 14:58:50 -0700 Subject: [PATCH] fix cursor mark preservation logic --- lib/models/transform.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/models/transform.js b/lib/models/transform.js index eee92c2e0..92c3385e9 100644 --- a/lib/models/transform.js +++ b/lib/models/transform.js @@ -198,8 +198,8 @@ class Transform extends new Record(DEFAULT_PROPERTIES) { // Apply each of the steps in the transform, arriving at a new state. state = steps.reduce((memo, step) => this.applyStep(memo, step), state) - // If the selection has changed, clear any existing cursor marks. - if (state.selection != selection) { + // If there are cursor marks and they haven't changed, remove them. + if (state.cursorMarks && state.cursorMarks == cursorMarks) { state = state.merge({ cursorMarks: null })