diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/Editor.cxx | 16 | ||||
-rw-r--r-- | src/ViewStyle.cxx | 11 | ||||
-rw-r--r-- | src/ViewStyle.h | 2 |
3 files changed, 17 insertions, 12 deletions
diff --git a/src/Editor.cxx b/src/Editor.cxx index 8453118b3..684d205e6 100644 --- a/src/Editor.cxx +++ b/src/Editor.cxx @@ -7690,18 +7690,10 @@ sptr_t Editor::WndProc(unsigned int iMessage, uptr_t wParam, sptr_t lParam) { InvalidateStyleRedraw(); break; - case SCI_MULTIEDGEADDLINE: { - // Insert new edge in sorted order. - const int column = static_cast<int>(wParam); - vs.theMultiEdge.insert( - std::upper_bound(vs.theMultiEdge.begin(), vs.theMultiEdge.end(), column, - [](const EdgeProperties &a, const EdgeProperties &b) { - return a.column < b.column; - }), - EdgeProperties(wParam, lParam)); - InvalidateStyleRedraw(); - break; - } + case SCI_MULTIEDGEADDLINE: + vs.AddMultiEdge(wParam, lParam); + InvalidateStyleRedraw(); + break; case SCI_MULTIEDGECLEARALL: std::vector<EdgeProperties>().swap(vs.theMultiEdge); // Free vector and memory, C++03 compatible diff --git a/src/ViewStyle.cxx b/src/ViewStyle.cxx index 7638317b7..da15e0d4e 100644 --- a/src/ViewStyle.cxx +++ b/src/ViewStyle.cxx @@ -503,6 +503,17 @@ ColourDesired ViewStyle::WrapColour() const noexcept { return styles[STYLE_DEFAULT].fore; } +// Insert new edge in sorted order. +void ViewStyle::AddMultiEdge(uptr_t wParam, sptr_t lParam) { + const int column = static_cast<int>(wParam); + theMultiEdge.insert( + std::upper_bound(theMultiEdge.begin(), theMultiEdge.end(), column, + [](const EdgeProperties &a, const EdgeProperties &b) { + return a.column < b.column; + }), + EdgeProperties(column, lParam)); +} + bool ViewStyle::SetWrapState(int wrapState_) noexcept { WrapMode wrapStateWanted; switch (wrapState_) { diff --git a/src/ViewStyle.h b/src/ViewStyle.h index c043cd45c..dc47ed380 100644 --- a/src/ViewStyle.h +++ b/src/ViewStyle.h @@ -193,6 +193,8 @@ public: bool WhitespaceBackgroundDrawn() const noexcept; ColourDesired WrapColour() const noexcept; + void AddMultiEdge(uptr_t wParam, sptr_t lParam); + bool SetWrapState(int wrapState_) noexcept; bool SetWrapVisualFlags(int wrapVisualFlags_) noexcept; bool SetWrapVisualFlagsLocation(int wrapVisualFlagsLocation_) noexcept; |