aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/EditView.cxx
diff options
context:
space:
mode:
authorZufu Liu <unknown>2021-10-24 21:05:52 +1100
committerZufu Liu <unknown>2021-10-24 21:05:52 +1100
commit83b67c1d70ac48dd242e7a7d6d248e26cddc69e4 (patch)
tree5e89ea486d175e77bc00a902d97e1c0f664feb40 /src/EditView.cxx
parent42c72b79878ae99c45532e46f12642b4e21affee (diff)
downloadscintilla-mirror-83b67c1d70ac48dd242e7a7d6d248e26cddc69e4.tar.gz
Avoid extra breaks introduced by revision 8993.
Diffstat (limited to 'src/EditView.cxx')
-rw-r--r--src/EditView.cxx10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/EditView.cxx b/src/EditView.cxx
index 30db6fb0d..444fb3283 100644
--- a/src/EditView.cxx
+++ b/src/EditView.cxx
@@ -464,7 +464,7 @@ void EditView::LayoutLine(const EditModel &model, Surface *surface, const ViewSt
ll->positions[0] = 0;
bool lastSegItalics = false;
- BreakFinder bfLayout(ll, nullptr, Range(0, numCharsInLine), posLineStart, 0, false, model.pdoc, &model.reprs, nullptr);
+ BreakFinder bfLayout(ll, nullptr, Range(0, numCharsInLine), posLineStart, 0, BreakFinder::BreakFor::Text, model.pdoc, &model.reprs, nullptr);
while (bfLayout.More()) {
const TextSegment ts = bfLayout.Next();
@@ -1762,7 +1762,8 @@ void EditView::DrawBackground(Surface *surface, const EditModel &model, const Vi
// Does not take margin into account but not significant
const XYPOSITION xStartVisible = static_cast<XYPOSITION>(subLineStart-xStart);
- BreakFinder bfBack(ll, &model.sel, lineRange, posLineStart, xStartVisible, selBackDrawn, model.pdoc, &model.reprs, &vsDraw);
+ const BreakFinder::BreakFor breakFor = selBackDrawn ? BreakFinder::BreakFor::Selection : BreakFinder::BreakFor::Text;
+ BreakFinder bfBack(ll, &model.sel, lineRange, posLineStart, xStartVisible, breakFor, model.pdoc, &model.reprs, &vsDraw);
const bool drawWhitespaceBackground = vsDraw.WhitespaceBackgroundDrawn() && !background;
@@ -1980,8 +1981,9 @@ void EditView::DrawForeground(Surface *surface, const EditModel &model, const Vi
const XYPOSITION xStartVisible = static_cast<XYPOSITION>(subLineStart-xStart);
// Foreground drawing loop
- BreakFinder bfFore(ll, &model.sel, lineRange, posLineStart, xStartVisible,
- (((phasesDraw == PhasesDraw::One) && selBackDrawn) || vsDraw.SelectionTextDrawn()), model.pdoc, &model.reprs, &vsDraw);
+ const BreakFinder::BreakFor breakFor = (((phasesDraw == PhasesDraw::One) && selBackDrawn) || vsDraw.SelectionTextDrawn())
+ ? BreakFinder::BreakFor::ForegroundAndSelection : BreakFinder::BreakFor::Foreground;
+ BreakFinder bfFore(ll, &model.sel, lineRange, posLineStart, xStartVisible, breakFor, model.pdoc, &model.reprs, &vsDraw);
while (bfFore.More()) {