From 24d86a87890bd21f8ba23e4c2bb8cfa25db00b3c Mon Sep 17 00:00:00 2001 From: Marijn Haverbeke Date: Tue, 28 Jun 2016 11:40:20 +0200 Subject: [PATCH] Stop blocking selection-undo in read-only mode Closes #4090 --- lib/codemirror.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/codemirror.js b/lib/codemirror.js index 476ab2e6e5..7be2fac1db 100644 --- a/lib/codemirror.js +++ b/lib/codemirror.js @@ -4419,7 +4419,7 @@ // Revert a change stored in a document's history. function makeChangeFromHistory(doc, type, allowSelectionOnly) { - if (doc.cm && doc.cm.state.suppressEdits) return; + if (doc.cm && doc.cm.state.suppressEdits && !allowSelectionOnly) return; var hist = doc.history, event, selAfter = doc.sel; var source = type == "undo" ? hist.done : hist.undone, dest = type == "undo" ? hist.undone : hist.done;