aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/Document.cxx41
-rw-r--r--src/Document.h3
2 files changed, 23 insertions, 21 deletions
diff --git a/src/Document.cxx b/src/Document.cxx
index 400769635..3750f99a8 100644
--- a/src/Document.cxx
+++ b/src/Document.cxx
@@ -55,7 +55,8 @@ Document::Document() {
stylingMask = 0;
endStyled = 0;
styleClock = 0;
- enteredCount = 0;
+ enteredModification = 0;
+ enteredStyling = 0;
enteredReadOnlyCount = 0;
tabInChars = 8;
indentInChars = 0;
@@ -369,10 +370,10 @@ bool Document::DeleteChars(int pos, int len) {
if ((pos + len) > Length())
return false;
CheckReadOnly();
- if (enteredCount != 0) {
+ if (enteredModification != 0) {
return false;
} else {
- enteredCount++;
+ enteredModification++;
if (!cb.IsReadOnly()) {
NotifyModified(
DocModification(
@@ -395,7 +396,7 @@ bool Document::DeleteChars(int pos, int len) {
pos, len,
LinesTotal() - prevLinesTotal, text));
}
- enteredCount--;
+ enteredModification--;
}
return !cb.IsReadOnly();
}
@@ -408,10 +409,10 @@ bool Document::InsertString(int position, const char *s, int insertLength) {
return false;
}
CheckReadOnly();
- if (enteredCount != 0) {
+ if (enteredModification != 0) {
return false;
} else {
- enteredCount++;
+ enteredModification++;
if (!cb.IsReadOnly()) {
NotifyModified(
DocModification(
@@ -431,7 +432,7 @@ bool Document::InsertString(int position, const char *s, int insertLength) {
position, insertLength,
LinesTotal() - prevLinesTotal, text));
}
- enteredCount--;
+ enteredModification--;
}
return !cb.IsReadOnly();
}
@@ -439,8 +440,8 @@ bool Document::InsertString(int position, const char *s, int insertLength) {
int Document::Undo() {
int newPos = -1;
CheckReadOnly();
- if (enteredCount == 0) {
- enteredCount++;
+ if (enteredModification == 0) {
+ enteredModification++;
if (!cb.IsReadOnly()) {
bool startSavePoint = cb.IsSavePoint();
bool multiLine = false;
@@ -487,7 +488,7 @@ int Document::Undo() {
if (startSavePoint != endSavePoint)
NotifySavePoint(endSavePoint);
}
- enteredCount--;
+ enteredModification--;
}
return newPos;
}
@@ -495,8 +496,8 @@ int Document::Undo() {
int Document::Redo() {
int newPos = -1;
CheckReadOnly();
- if (enteredCount == 0) {
- enteredCount++;
+ if (enteredModification == 0) {
+ enteredModification++;
if (!cb.IsReadOnly()) {
bool startSavePoint = cb.IsSavePoint();
bool multiLine = false;
@@ -541,7 +542,7 @@ int Document::Redo() {
if (startSavePoint != endSavePoint)
NotifySavePoint(endSavePoint);
}
- enteredCount--;
+ enteredModification--;
}
return newPos;
}
@@ -1275,10 +1276,10 @@ void Document::StartStyling(int position, char mask) {
}
bool Document::SetStyleFor(int length, char style) {
- if (enteredCount != 0) {
+ if (enteredStyling != 0) {
return false;
} else {
- enteredCount++;
+ enteredStyling++;
style &= stylingMask;
int prevEndStyled = endStyled;
if (cb.SetStyleFor(endStyled, length, style, stylingMask)) {
@@ -1287,16 +1288,16 @@ bool Document::SetStyleFor(int length, char style) {
NotifyModified(mh);
}
endStyled += length;
- enteredCount--;
+ enteredStyling--;
return true;
}
}
bool Document::SetStyles(int length, char *styles) {
- if (enteredCount != 0) {
+ if (enteredStyling != 0) {
return false;
} else {
- enteredCount++;
+ enteredStyling++;
bool didChange = false;
int startMod = 0;
int endMod = 0;
@@ -1315,13 +1316,13 @@ bool Document::SetStyles(int length, char *styles) {
startMod, endMod - startMod + 1);
NotifyModified(mh);
}
- enteredCount--;
+ enteredStyling--;
return true;
}
}
void Document::EnsureStyledTo(int pos) {
- if ((enteredCount == 0) && (pos > GetEndStyled())) {
+ if ((enteredStyling == 0) && (pos > GetEndStyled())) {
IncrementStyleClock();
// Ask the watchers to style, and stop as soon as one responds.
for (int i = 0; pos > GetEndStyled() && i < lenWatchers; i++) {
diff --git a/src/Document.h b/src/Document.h
index aaa19e493..829ecbd81 100644
--- a/src/Document.h
+++ b/src/Document.h
@@ -97,7 +97,8 @@ private:
char stylingMask;
int endStyled;
int styleClock;
- int enteredCount;
+ int enteredModification;
+ int enteredStyling;
int enteredReadOnlyCount;
WatcherWithUserData *watchers;