aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/CellBuffer.cxx
diff options
context:
space:
mode:
authorNeil <nyamatongwe@gmail.com>2024-02-09 21:25:16 +1100
committerNeil <nyamatongwe@gmail.com>2024-02-09 21:25:16 +1100
commit8df2193739e8e37b0ab4c0c31a0e1741351c801f (patch)
treedf8ec6858a499c3318d51df3c90d6f04f82a6d4b /src/CellBuffer.cxx
parentc57d85c5a8872d192c11f7020ef7c13fbefff206 (diff)
downloadscintilla-mirror-8df2193739e8e37b0ab4c0c31a0e1741351c801f.tar.gz
Avoid overhead of extra start actions that delimited user operations. Now relies
on mayCoalesce flag to indicate that a user operation is complete when false.
Diffstat (limited to 'src/CellBuffer.cxx')
-rw-r--r--src/CellBuffer.cxx14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/CellBuffer.cxx b/src/CellBuffer.cxx
index 01074d666..bfef83da5 100644
--- a/src/CellBuffer.cxx
+++ b/src/CellBuffer.cxx
@@ -1062,11 +1062,11 @@ bool CellBuffer::IsCollectingUndo() const noexcept {
return collectingUndo;
}
-void CellBuffer::BeginUndoAction() {
+void CellBuffer::BeginUndoAction() noexcept {
uh->BeginUndoAction();
}
-void CellBuffer::EndUndoAction() {
+void CellBuffer::EndUndoAction() noexcept {
uh->EndUndoAction();
}
@@ -1075,7 +1075,7 @@ void CellBuffer::AddUndoAction(Sci::Position token, bool mayCoalesce) {
uh->AppendAction(ActionType::container, token, nullptr, 0, startSequence, mayCoalesce);
}
-void CellBuffer::DeleteUndoHistory() {
+void CellBuffer::DeleteUndoHistory() noexcept {
uh->DeleteUndoHistory();
}
@@ -1093,7 +1093,7 @@ Action CellBuffer::GetUndoStep() const noexcept {
void CellBuffer::PerformUndoStep() {
const Action actionStep = uh->GetUndoStep();
- if (changeHistory && uh->BeforeSavePoint()) {
+ if (changeHistory && uh->BeforeOrAtSavePoint()) {
changeHistory->StartReversion();
}
if (actionStep.at == ActionType::insert) {
@@ -1103,7 +1103,7 @@ void CellBuffer::PerformUndoStep() {
}
if (changeHistory) {
changeHistory->DeleteRange(actionStep.position, actionStep.lenData,
- uh->BeforeSavePoint() && !uh->AfterDetachPoint());
+ uh->BeforeOrAtSavePoint() && !uh->AfterDetachPoint());
}
BasicDeleteChars(actionStep.position, actionStep.lenData);
} else if (actionStep.at == ActionType::remove) {
@@ -1128,12 +1128,12 @@ Action CellBuffer::GetRedoStep() const noexcept {
}
void CellBuffer::PerformRedoStep() {
- Action actionStep = uh->GetRedoStep();
+ const Action actionStep = uh->GetRedoStep();
if (actionStep.at == ActionType::insert) {
BasicInsertString(actionStep.position, actionStep.data, actionStep.lenData);
if (changeHistory) {
changeHistory->Insert(actionStep.position, actionStep.lenData, collectingUndo,
- uh->BeforeSavePoint() && !uh->AfterDetachPoint());
+ uh->BeforeSavePoint() && !uh->AfterOrAtDetachPoint());
}
} else if (actionStep.at == ActionType::remove) {
if (changeHistory) {