diff options
Diffstat (limited to 'src/UndoHistory.cxx')
-rw-r--r-- | src/UndoHistory.cxx | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/UndoHistory.cxx b/src/UndoHistory.cxx index 62f871a60..810cd9a14 100644 --- a/src/UndoHistory.cxx +++ b/src/UndoHistory.cxx @@ -395,6 +395,18 @@ bool UndoHistory::AfterSavePoint() const noexcept { return (savePoint >= 0) && (savePoint <= currentAction); } +void UndoHistory::SetDetachPoint(int action) noexcept { + if (action == -1) { + detach = {}; + } else { + detach = action; + } +} + +int UndoHistory::DetachPoint() const noexcept { + return detach.value_or(-1); +} + bool UndoHistory::AfterDetachPoint() const noexcept { return detach && (*detach < currentAction); } |