diff options
author | Neil <nyamatongwe@gmail.com> | 2023-11-06 07:59:06 +1100 |
---|---|---|
committer | Neil <nyamatongwe@gmail.com> | 2023-11-06 07:59:06 +1100 |
commit | 1272f93ac3afd3892d04364fdc5abba56161951d (patch) | |
tree | 24a1fdc65b970786b829d503e50cd2b74f48ce08 | |
parent | 26b60d88b6d848f3ba55ca046852e079be5fe3c6 (diff) | |
download | scintilla-mirror-1272f93ac3afd3892d04364fdc5abba56161951d.tar.gz |
Extract DropSelection into a method so it can be reused.
-rw-r--r-- | src/Editor.cxx | 10 | ||||
-rw-r--r-- | src/Editor.h | 1 |
2 files changed, 8 insertions, 3 deletions
diff --git a/src/Editor.cxx b/src/Editor.cxx index 527c9b47c..d498cc0d7 100644 --- a/src/Editor.cxx +++ b/src/Editor.cxx @@ -4557,6 +4557,12 @@ Window::Cursor Editor::GetMarginCursor(Point pt) const noexcept { return Window::Cursor::reverseArrow; } +void Editor::DropSelection(size_t part) { + sel.DropSelection(part); + ContainerNeedsUpdate(Update::Selection); + Redraw(); +} + void Editor::TrimAndSetSelection(Sci::Position currentPos_, Sci::Position anchor_) { sel.TrimSelection(SelectionRange(currentPos_, anchor_)); SetSelection(currentPos_, anchor_); @@ -8702,9 +8708,7 @@ sptr_t Editor::WndProc(Message iMessage, uptr_t wParam, sptr_t lParam) { return SelectionFromPoint(PointFromParameters(wParam, lParam)); case Message::DropSelectionN: - sel.DropSelection(wParam); - ContainerNeedsUpdate(Update::Selection); - Redraw(); + DropSelection(wParam); break; case Message::SetMainSelection: diff --git a/src/Editor.h b/src/Editor.h index 19b0c730c..923e3b7a3 100644 --- a/src/Editor.h +++ b/src/Editor.h @@ -530,6 +530,7 @@ protected: // ScintillaBase subclass needs access to much of Editor ptrdiff_t SelectionFromPoint(Point pt); bool PointInSelMargin(Point pt) const; Window::Cursor GetMarginCursor(Point pt) const noexcept; + void DropSelection(size_t part); void TrimAndSetSelection(Sci::Position currentPos_, Sci::Position anchor_); void LineSelection(Sci::Position lineCurrentPos_, Sci::Position lineAnchorPos_, bool wholeLine); void WordSelection(Sci::Position pos); |