From 926cb6f7d228b347db16a45e1f2632da475da1f0 Mon Sep 17 00:00:00 2001 From: Neil Date: Sun, 31 Jul 2022 15:51:53 +1000 Subject: Added change history which can display document changes (modified, saved, ...) in the margin or in the text. --- src/CellBuffer.h | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'src/CellBuffer.h') 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 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; + std::unique_ptr 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; }; } -- cgit v1.2.3