aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorJohn Ehresman <unknown>2024-03-02 16:58:47 +1100
committerJohn Ehresman <unknown>2024-03-02 16:58:47 +1100
commite99c07091ec1cebc855bcda42426286872d3a667 (patch)
tree8ff2d1252c2d262393fa5f53a54e50eb97510aa1 /src
parent899913225fe6cc67b30be125ef222ce93b87eb22 (diff)
downloadscintilla-mirror-e99c07091ec1cebc855bcda42426286872d3a667.tar.gz
Feature [feature-requests:#1511] Add mayCoalesce argument to BeginUndoAction.
Diffstat (limited to 'src')
-rw-r--r--src/CellBuffer.cxx4
-rw-r--r--src/CellBuffer.h2
-rw-r--r--src/Document.h2
-rw-r--r--src/UndoHistory.cxx4
-rw-r--r--src/UndoHistory.h2
5 files changed, 7 insertions, 7 deletions
diff --git a/src/CellBuffer.cxx b/src/CellBuffer.cxx
index 1ffc749bf..bf0ca6ba5 100644
--- a/src/CellBuffer.cxx
+++ b/src/CellBuffer.cxx
@@ -1062,8 +1062,8 @@ bool CellBuffer::IsCollectingUndo() const noexcept {
return collectingUndo;
}
-void CellBuffer::BeginUndoAction() noexcept {
- uh->BeginUndoAction();
+void CellBuffer::BeginUndoAction(bool mayCoalesce) noexcept {
+ uh->BeginUndoAction(mayCoalesce);
}
void CellBuffer::EndUndoAction() noexcept {
diff --git a/src/CellBuffer.h b/src/CellBuffer.h
index 1c598480f..3a72601a6 100644
--- a/src/CellBuffer.h
+++ b/src/CellBuffer.h
@@ -164,7 +164,7 @@ public:
bool SetUndoCollection(bool collectUndo) noexcept;
bool IsCollectingUndo() const noexcept;
- void BeginUndoAction() noexcept;
+ void BeginUndoAction(bool mayCoalesce=false) noexcept;
void EndUndoAction() noexcept;
void AddUndoAction(Sci::Position token, bool mayCoalesce);
void DeleteUndoHistory() noexcept;
diff --git a/src/Document.h b/src/Document.h
index 912c719b5..102af4d2e 100644
--- a/src/Document.h
+++ b/src/Document.h
@@ -395,7 +395,7 @@ public:
return cb.SetUndoCollection(collectUndo);
}
bool IsCollectingUndo() const noexcept { return cb.IsCollectingUndo(); }
- void BeginUndoAction() noexcept { cb.BeginUndoAction(); }
+ void BeginUndoAction(bool coalesceWithPrior=false) noexcept { cb.BeginUndoAction(coalesceWithPrior); }
void EndUndoAction() noexcept { cb.EndUndoAction(); }
void AddUndoAction(Sci::Position token, bool mayCoalesce) { cb.AddUndoAction(token, mayCoalesce); }
void SetSavePoint();
diff --git a/src/UndoHistory.cxx b/src/UndoHistory.cxx
index 0c8644f16..c94d0690c 100644
--- a/src/UndoHistory.cxx
+++ b/src/UndoHistory.cxx
@@ -322,10 +322,10 @@ const char *UndoHistory::AppendAction(ActionType at, Sci::Position position, con
return dataNew;
}
-void UndoHistory::BeginUndoAction() noexcept {
+void UndoHistory::BeginUndoAction(bool mayCoalesce) noexcept {
if (undoSequenceDepth == 0) {
if (currentAction > 0) {
- actions.types[PreviousAction()].mayCoalesce = false;
+ actions.types[PreviousAction()].mayCoalesce = mayCoalesce;
}
}
undoSequenceDepth++;
diff --git a/src/UndoHistory.h b/src/UndoHistory.h
index 8de636f8d..8d39a908d 100644
--- a/src/UndoHistory.h
+++ b/src/UndoHistory.h
@@ -97,7 +97,7 @@ public:
const char *AppendAction(ActionType at, Sci::Position position, const char *data, Sci::Position lengthData, bool &startSequence, bool mayCoalesce=true);
- void BeginUndoAction() noexcept;
+ void BeginUndoAction(bool mayCoalesce=false) noexcept;
void EndUndoAction() noexcept;
void DropUndoSequence() noexcept;
void DeleteUndoHistory() noexcept;