aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorPawel Z Wronek <unknown>2024-11-25 08:28:55 +1100
committerPawel Z Wronek <unknown>2024-11-25 08:28:55 +1100
commitb1280b8651fce6be3e020ced53ecb5a17b59a7ab (patch)
tree0d5286ca5961bc0ddd50b4ae1a43c11fea50aed4
parent28ee322763282711d4394e092aeefd29e9f972bb (diff)
downloadscintilla-mirror-b1280b8651fce6be3e020ced53ecb5a17b59a7ab.tar.gz
Bug [#2456]. Fix wrapping removed lines.
-rw-r--r--doc/ScintillaHistory.html6
-rw-r--r--src/Editor.cxx6
2 files changed, 12 insertions, 0 deletions
diff --git a/doc/ScintillaHistory.html b/doc/ScintillaHistory.html
index 2f1a4dfcb..b8fe778a7 100644
--- a/doc/ScintillaHistory.html
+++ b/doc/ScintillaHistory.html
@@ -582,6 +582,8 @@
<td>Gary James</td>
<td>Tsuyoshi Miyake</td>
<td>Martijn Laan</td>
+ </tr><tr>
+ <td>Pawel Z Wronek</td>
</tr>
</table>
<h2>Releases</h2>
@@ -601,6 +603,10 @@
<a href="https://sourceforge.net/p/scintilla/feature-requests/1533/">Feature #1533</a>.
</li>
<li>
+ Fix wrapping removed lines.
+ <a href="https://sourceforge.net/p/scintilla/bugs/2456/">Bug #2456</a>.
+ </li>
+ <li>
On GTK, allow middle click to insert multiple times within a document.
<a href="https://github.com/geany/geany/issues/2629">Geany Issue #2629</a>.
</li>
diff --git a/src/Editor.cxx b/src/Editor.cxx
index d1bcfa02a..1c3437b7e 100644
--- a/src/Editor.cxx
+++ b/src/Editor.cxx
@@ -2634,6 +2634,12 @@ void Editor::CheckModificationForWrap(DocModification mh) {
const Sci::Line lineDoc = pdoc->SciLineFromPosition(mh.position);
const Sci::Line lines = std::max(static_cast<Sci::Line>(0), mh.linesAdded);
if (Wrapping()) {
+ // Check if this modification crosses any of the wrap points
+ if (wrapPending.NeedsWrap()) {
+ if (lineDoc < wrapPending.end) { // Inserted/deleted before or inside wrap range
+ wrapPending.end += mh.linesAdded;
+ }
+ }
NeedWrapping(lineDoc, lineDoc + lines + 1);
}
RefreshStyleData();