From cb8cd73d839a96f98bb1ce887c694271f9c24788 Mon Sep 17 00:00:00 2001 From: Neil Date: Tue, 22 Nov 2022 09:24:07 +1100 Subject: Add SCI_REPLACETARGETMINIMAL to change text without causing unchanged prefix and suffix to be marked as modified in change history. --- src/Document.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/Document.h') diff --git a/src/Document.h b/src/Document.h index ae784180a..ac9c6670c 100644 --- a/src/Document.h +++ b/src/Document.h @@ -46,6 +46,10 @@ public: return (start != Sci::invalidPosition) && (end != Sci::invalidPosition); } + [[nodiscard]] bool Empty() const noexcept { + return start == end; + } + Sci::Position First() const noexcept { return (start <= end) ? start : end; } @@ -369,6 +373,7 @@ public: // Gateways to modifying document void ModifiedAt(Sci::Position pos) noexcept; void CheckReadOnly(); + void TrimReplacement(std::string_view &text, Range &range) const noexcept; bool DeleteChars(Sci::Position pos, Sci::Position len); Sci::Position InsertString(Sci::Position position, const char *s, Sci::Position insertLength); Sci::Position InsertString(Sci::Position position, std::string_view sv); -- cgit v1.2.3