aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/EditModel.cxx
diff options
context:
space:
mode:
authorNeil <nyamatongwe@gmail.com>2021-05-01 16:48:50 +1000
committerNeil <nyamatongwe@gmail.com>2021-05-01 16:48:50 +1000
commit93591238af8bf8b5246adcfe7a115f443442f44e (patch)
tree94b402e2a6c39d622a49be999517ff83be9ce378 /src/EditModel.cxx
parent1f5a3b0b2d81351819ebb189a1ae4379e8762e75 (diff)
downloadscintilla-mirror-93591238af8bf8b5246adcfe7a115f443442f44e.tar.gz
Improve selection drawing code. Use InSelection enum instead of int.
Add Selection::RangeType and EditModel::LineEndInSelection to hoist code out of EditView. Replace SimpleAlphaRectangle with Surface::FillRectangleAligned when alpha known to not be SC_ALPHA_NOALPHA.
Diffstat (limited to 'src/EditModel.cxx')
-rw-r--r--src/EditModel.cxx5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/EditModel.cxx b/src/EditModel.cxx
index c7fe1c710..d84ad7e21 100644
--- a/src/EditModel.cxx
+++ b/src/EditModel.cxx
@@ -110,3 +110,8 @@ const char *EditModel::GetFoldDisplayText(Sci::Line lineDoc) const noexcept {
const char *text = pcs->GetFoldDisplayText(lineDoc);
return text ? text : defaultFoldDisplayText.get();
}
+
+InSelection EditModel::LineEndInSelection(Sci::Line lineDoc) const {
+ const Sci::Position posAfterLineEnd = pdoc->LineStart(lineDoc + 1);
+ return sel.InSelectionForEOL(posAfterLineEnd);
+}