aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authornyamatongwe <nyamatongwe@gmail.com>2013-04-17 13:56:08 +1000
committernyamatongwe <nyamatongwe@gmail.com>2013-04-17 13:56:08 +1000
commit8f5bc219c07a66c01f351901109d7bac2d602bd9 (patch)
tree2cbab4991f377667bc828f8fb390460446e51b2b /src
parent359a2e69d0ab976aa664a1658c07bda74a591da7 (diff)
downloadscintilla-mirror-8f5bc219c07a66c01f351901109d7bac2d602bd9.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.cxx4
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();