diff options
author | nyamatongwe <nyamatongwe@gmail.com> | 2013-04-17 13:56:08 +1000 |
---|---|---|
committer | nyamatongwe <nyamatongwe@gmail.com> | 2013-04-17 13:56:08 +1000 |
commit | d9fe689036b43c44b72043ab52982474fc6193d2 (patch) | |
tree | 566ff4739a9384942ee9a35e299614619c6c2cac /src | |
parent | 2347b18b63c611bfb071e7a7fc086ff28c5abd01 (diff) | |
download | scintilla-mirror-d9fe689036b43c44b72043ab52982474fc6193d2.tar.gz |
Disallow undo and redo when not collecting undo as it is likely that the document
is not in the state at the end of the undo history and performing undo will not be able
to return to a previous state.
Diffstat (limited to 'src')
-rw-r--r-- | src/Document.cxx | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/Document.cxx b/src/Document.cxx index 56785af78..7eef844ee 100644 --- a/src/Document.cxx +++ b/src/Document.cxx @@ -892,7 +892,7 @@ void * SCI_METHOD Document::ConvertToDocument() { int Document::Undo() { int newPos = -1; CheckReadOnly(); - if (enteredModification == 0) { + if ((enteredModification == 0) && (cb.IsCollectingUndo())) { enteredModification++; if (!cb.IsReadOnly()) { bool startSavePoint = cb.IsSavePoint(); @@ -977,7 +977,7 @@ int Document::Undo() { int Document::Redo() { int newPos = -1; CheckReadOnly(); - if (enteredModification == 0) { + if ((enteredModification == 0) && (cb.IsCollectingUndo())) { enteredModification++; if (!cb.IsReadOnly()) { bool startSavePoint = cb.IsSavePoint(); |