aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorZufu Liu <unknown>2023-02-12 11:26:48 +1100
committerZufu Liu <unknown>2023-02-12 11:26:48 +1100
commit5848ae9e694b196e24f10e830c517e0f613b80ae (patch)
treedaf86b3a99c25733c884d512bace47ea12c5dd6c
parentf2455fabf07576db6224262ce8b62a59429534e3 (diff)
downloadscintilla-mirror-5848ae9e694b196e24f10e830c517e0f613b80ae.tar.gz
Bug [#2378]. Fix overlapping of text with line end wrap marker.
-rw-r--r--doc/ScintillaHistory.html12
-rw-r--r--src/EditView.cxx2
-rw-r--r--src/PositionCache.cxx6
-rw-r--r--src/PositionCache.h2
4 files changed, 17 insertions, 5 deletions
diff --git a/doc/ScintillaHistory.html b/doc/ScintillaHistory.html
index d4a024182..2d195d142 100644
--- a/doc/ScintillaHistory.html
+++ b/doc/ScintillaHistory.html
@@ -580,6 +580,18 @@
</table>
<h2>Releases</h2>
<h3>
+ <a href="https://www.scintilla.org/scintilla534.zip">Release 5.3.4</a>
+ </h3>
+ <ul>
+ <li>
+ Released 8 February 2023.
+ </li>
+ <li>
+ Fix overlapping of text with line end wrap marker.
+ <a href="https://sourceforge.net/p/scintilla/bugs/2378/">Bug #2378</a>.
+ </li>
+ </ul>
+ <h3>
<a href="https://www.scintilla.org/scintilla533.zip">Release 5.3.3</a>
</h3>
<ul>
diff --git a/src/EditView.cxx b/src/EditView.cxx
index cc7b5dcf5..3ba1ee4e5 100644
--- a/src/EditView.cxx
+++ b/src/EditView.cxx
@@ -599,7 +599,7 @@ void EditView::LayoutLine(const EditModel &model, Surface *surface, const ViewSt
// Check for wrapIndent minimum
if ((FlagSet(vstyle.wrap.visualFlags, WrapVisualFlag::Start)) && (ll->wrapIndent < vstyle.aveCharWidth))
ll->wrapIndent = vstyle.aveCharWidth; // Indent to show start visual
- ll->WrapLine(model.pdoc, posLineStart, vstyle.wrap.state);
+ ll->WrapLine(model.pdoc, posLineStart, vstyle.wrap.state, width);
}
ll->validity = LineLayout::ValidLevel::lines;
}
diff --git a/src/PositionCache.cxx b/src/PositionCache.cxx
index a0aece160..a0b7f3129 100644
--- a/src/PositionCache.cxx
+++ b/src/PositionCache.cxx
@@ -326,7 +326,7 @@ int LineLayout::EndLineStyle() const noexcept {
return styles[numCharsBeforeEOL > 0 ? numCharsBeforeEOL-1 : 0];
}
-void LineLayout::WrapLine(const Document *pdoc, Sci::Position posLineStart, Wrap wrapState) {
+void LineLayout::WrapLine(const Document *pdoc, Sci::Position posLineStart, Wrap wrapState, XYPOSITION wrapWidth) {
// Document wants document positions but simpler to work in line positions
// so take care of adding and subtracting line start in a lambda.
auto CharacterBoundary = [=](Sci::Position i, Sci::Position moveDir) noexcept -> Sci::Position {
@@ -335,7 +335,7 @@ void LineLayout::WrapLine(const Document *pdoc, Sci::Position posLineStart, Wrap
lines = 0;
// Calculate line start positions based upon width.
Sci::Position lastLineStart = 0;
- XYPOSITION startOffset = widthLine;
+ XYPOSITION startOffset = wrapWidth;
Sci::Position p = 0;
while (p < numCharsInLine) {
while (p < numCharsInLine && positions[p + 1] < startOffset) {
@@ -377,7 +377,7 @@ void LineLayout::WrapLine(const Document *pdoc, Sci::Position posLineStart, Wrap
AddLineStart(lastLineStart);
startOffset = positions[lastLineStart];
// take into account the space for start wrap mark and indent
- startOffset += widthLine - wrapIndent;
+ startOffset += wrapWidth - wrapIndent;
p = lastLineStart + 1;
}
}
diff --git a/src/PositionCache.h b/src/PositionCache.h
index e830b67dc..231b9791e 100644
--- a/src/PositionCache.h
+++ b/src/PositionCache.h
@@ -107,7 +107,7 @@ public:
Interval Span(int start, int end) const noexcept;
Interval SpanByte(int index) const noexcept;
int EndLineStyle() const noexcept;
- void WrapLine(const Document *pdoc, Sci::Position posLineStart, Wrap wrapState);
+ void WrapLine(const Document *pdoc, Sci::Position posLineStart, Wrap wrapState, XYPOSITION wrapWidth);
};
struct ScreenLine : public IScreenLine {