diff options
author | Neil <nyamatongwe@gmail.com> | 2024-09-02 08:42:25 +1000 |
---|---|---|
committer | Neil <nyamatongwe@gmail.com> | 2024-09-02 08:42:25 +1000 |
commit | 5977b000998149b60a80fa4bb779a663078b951a (patch) | |
tree | cc1ddb6b909d01c8eb9159116f4d02b03d150d2c /src/Editor.h | |
parent | 8cffa89c3bae58e55b61b24b9cfc76baad3584da (diff) | |
download | scintilla-mirror-5977b000998149b60a80fa4bb779a663078b951a.tar.gz |
Hoist some common code into methods.
RangeContainsProtected gains an overload that takes a SelectionRange as this is
common use and simplifies callers.
ClearSelectionRange is common code used to clear selected text and update a
SelectionRange before inserting text.
Diffstat (limited to 'src/Editor.h')
-rw-r--r-- | src/Editor.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/Editor.h b/src/Editor.h index 0cfdaf64e..d95f552ad 100644 --- a/src/Editor.h +++ b/src/Editor.h @@ -355,6 +355,7 @@ protected: // ScintillaBase subclass needs access to much of Editor enum class AddNumber { one, each }; void MultipleSelectAdd(AddNumber addNumber); bool RangeContainsProtected(Sci::Position start, Sci::Position end) const noexcept; + bool RangeContainsProtected(const SelectionRange &range) const noexcept; bool SelectionContainsProtected() const noexcept; Sci::Position MovePositionOutsideChar(Sci::Position pos, Sci::Position moveDir, bool checkLineEnd=true) const; SelectionPosition MovePositionOutsideChar(SelectionPosition pos, Sci::Position moveDir, bool checkLineEnd=true) const; @@ -425,6 +426,7 @@ protected: // ScintillaBase subclass needs access to much of Editor SelectionPosition RealizeVirtualSpace(const SelectionPosition &position); void AddChar(char ch); virtual void InsertCharacter(std::string_view sv, Scintilla::CharacterSource charSource); + void ClearSelectionRange(SelectionRange &range); void ClearBeforeTentativeStart(); void InsertPaste(const char *text, Sci::Position len); enum class PasteShape { stream=0, rectangular = 1, line = 2 }; |