From 38d2856d341358bf9c691157ae0ca2e8960e35df Mon Sep 17 00:00:00 2001 From: Neil Date: Thu, 15 Feb 2024 14:17:08 +1100 Subject: Perform validation of undo state when SCI_SETUNDOCURRENT called, setting status when invalid. --- src/UndoHistory.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/UndoHistory.h') diff --git a/src/UndoHistory.h b/src/UndoHistory.h index 1186a1e0e..13aaca98c 100644 --- a/src/UndoHistory.h +++ b/src/UndoHistory.h @@ -53,6 +53,7 @@ struct UndoActions { [[nodiscard]] intptr_t SSize() const noexcept; void Create(size_t index, ActionType at_, Sci::Position position_, Sci::Position lenData_, bool mayCoalesce_); [[nodiscard]] bool AtStart(size_t index) const noexcept; + [[nodiscard]] size_t LengthTo(size_t index) const noexcept; }; class ScrapStack { @@ -112,7 +113,9 @@ public: bool AfterDetachPoint() const noexcept; bool AfterOrAtDetachPoint() const noexcept; - void SetCurrent(int action) noexcept; + [[nodiscard]] intptr_t Delta(int action) noexcept; + [[nodiscard]] bool Validate(intptr_t lengthDocument) noexcept; + void SetCurrent(int action, intptr_t lengthDocument); [[nodiscard]] int Current() const noexcept; [[nodiscard]] int Type(int action) const noexcept; [[nodiscard]] Sci::Position Position(int action) const noexcept; -- cgit v1.2.3