From 51772590cc76ec5486fdd7070578f26d033b72b3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philipp=20Ku=CC=88hn?= Date: Wed, 17 Feb 2021 23:24:58 +0100 Subject: [PATCH] add comment --- packages/core/src/commands/focus.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/packages/core/src/commands/focus.ts b/packages/core/src/commands/focus.ts index f1094729..c1ad5f5f 100644 --- a/packages/core/src/commands/focus.ts +++ b/packages/core/src/commands/focus.ts @@ -67,6 +67,8 @@ export const focus: RawCommands['focus'] = (position = null) => ({ if (dispatch) { tr.setSelection(selection) + // `tr.setSelection` resets the stored marks + // so we’ll restore them if the selection is the same as before if (isSameSelection && storedMarks) { tr.setStoredMarks(storedMarks) }