diff options
author | Neil <nyamatongwe@gmail.com> | 2022-07-31 15:51:53 +1000 |
---|---|---|
committer | Neil <nyamatongwe@gmail.com> | 2022-07-31 15:51:53 +1000 |
commit | 926cb6f7d228b347db16a45e1f2632da475da1f0 (patch) | |
tree | 6263662cb8c023502d61b61eed34baa93ed35843 /src/CellBuffer.h | |
parent | 535e20189d5a2dd9b43a6ea0a74749a50678d631 (diff) | |
download | scintilla-mirror-926cb6f7d228b347db16a45e1f2632da475da1f0.tar.gz |
Added change history which can display document changes (modified, saved, ...)
in the margin or in the text.
Diffstat (limited to 'src/CellBuffer.h')
-rw-r--r-- | src/CellBuffer.h | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/CellBuffer.h b/src/CellBuffer.h index 727e14944..7f0b87c4d 100644 --- a/src/CellBuffer.h +++ b/src/CellBuffer.h @@ -20,6 +20,7 @@ public: virtual void RemoveLine(Sci::Line line)=0; }; +class ChangeHistory; /** * The line vector contains information about each of the lines in a cell buffer. */ @@ -53,6 +54,7 @@ class UndoHistory { int undoSequenceDepth; int savePoint; int tentativePoint; + std::optional<int> detach; void EnsureUndoRoom(); @@ -70,6 +72,10 @@ public: /// the buffer was saved. Undo and redo can move over the save point. void SetSavePoint() noexcept; bool IsSavePoint() const noexcept; + bool BeforeSavePoint() const noexcept; + bool BeforeReachableSavePoint() const noexcept; + bool AfterSavePoint() const noexcept; + bool AfterDetachPoint() const noexcept; // Tentative actions are used for input composition so that it can be undone cleanly void TentativeStart(); @@ -133,6 +139,8 @@ private: bool collectingUndo; UndoHistory uh; + std::unique_ptr<ChangeHistory> changeHistory; + std::unique_ptr<ILineVector> plv; bool UTF8LineEndOverlaps(Sci::Position position) const noexcept; @@ -224,6 +232,12 @@ public: int StartRedo(); const Action &GetRedoStep() const; void PerformRedoStep(); + + void ChangeHistorySet(bool set); + [[nodiscard]] int EditionAt(Sci::Position pos) const noexcept; + [[nodiscard]] Sci::Position EditionEndRun(Sci::Position pos) const noexcept; + [[nodiscard]] unsigned int EditionDeletesAt(Sci::Position pos) const noexcept; + [[nodiscard]] Sci::Position EditionNextDelete(Sci::Position pos) const noexcept; }; } |