diff options
author | John Ehresman <unknown> | 2024-03-02 16:58:47 +1100 |
---|---|---|
committer | John Ehresman <unknown> | 2024-03-02 16:58:47 +1100 |
commit | e99c07091ec1cebc855bcda42426286872d3a667 (patch) | |
tree | 8ff2d1252c2d262393fa5f53a54e50eb97510aa1 | |
parent | 899913225fe6cc67b30be125ef222ce93b87eb22 (diff) | |
download | scintilla-mirror-e99c07091ec1cebc855bcda42426286872d3a667.tar.gz |
Feature [feature-requests:#1511] Add mayCoalesce argument to BeginUndoAction.
-rw-r--r-- | qt/ScintillaEdit/ScintillaDocument.cpp | 4 | ||||
-rw-r--r-- | qt/ScintillaEdit/ScintillaDocument.h | 2 | ||||
-rw-r--r-- | src/CellBuffer.cxx | 4 | ||||
-rw-r--r-- | src/CellBuffer.h | 2 | ||||
-rw-r--r-- | src/Document.h | 2 | ||||
-rw-r--r-- | src/UndoHistory.cxx | 4 | ||||
-rw-r--r-- | src/UndoHistory.h | 2 |
7 files changed, 10 insertions, 10 deletions
diff --git a/qt/ScintillaEdit/ScintillaDocument.cpp b/qt/ScintillaEdit/ScintillaDocument.cpp index 977edc45f..b1091cec8 100644 --- a/qt/ScintillaEdit/ScintillaDocument.cpp +++ b/qt/ScintillaEdit/ScintillaDocument.cpp @@ -153,8 +153,8 @@ bool ScintillaDocument::is_collecting_undo() { return (static_cast<Document *>(pdoc))->IsCollectingUndo(); } -void ScintillaDocument::begin_undo_action() { - (static_cast<Document *>(pdoc))->BeginUndoAction(); +void ScintillaDocument::begin_undo_action(bool coalesceWithPrior) { + (static_cast<Document *>(pdoc))->BeginUndoAction(coalesceWithPrior); } void ScintillaDocument::end_undo_action() { diff --git a/qt/ScintillaEdit/ScintillaDocument.h b/qt/ScintillaEdit/ScintillaDocument.h index 8108fd2fa..fa129d53b 100644 --- a/qt/ScintillaEdit/ScintillaDocument.h +++ b/qt/ScintillaEdit/ScintillaDocument.h @@ -50,7 +50,7 @@ public: void delete_undo_history(); bool set_undo_collection(bool collect_undo); bool is_collecting_undo(); - void begin_undo_action(); + void begin_undo_action(bool coalesceWithPrior = false); void end_undo_action(); void set_save_point(); bool is_save_point(); 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; |