diff options
author | Neil <nyamatongwe@gmail.com> | 2024-02-15 14:17:08 +1100 |
---|---|---|
committer | Neil <nyamatongwe@gmail.com> | 2024-02-15 14:17:08 +1100 |
commit | 38d2856d341358bf9c691157ae0ca2e8960e35df (patch) | |
tree | a1a187630421e954b65181bb2d2fb4a58d2549ff /src/UndoHistory.h | |
parent | a6a2fe933e0103464c1a357f987ad10e3bcf6622 (diff) | |
download | scintilla-mirror-38d2856d341358bf9c691157ae0ca2e8960e35df.tar.gz |
Perform validation of undo state when SCI_SETUNDOCURRENT called, setting status
when invalid.
Diffstat (limited to 'src/UndoHistory.h')
-rw-r--r-- | src/UndoHistory.h | 5 |
1 files changed, 4 insertions, 1 deletions
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; |