From b1280b8651fce6be3e020ced53ecb5a17b59a7ab Mon Sep 17 00:00:00 2001 From: Pawel Z Wronek Date: Mon, 25 Nov 2024 08:28:55 +1100 Subject: Bug [#2456]. Fix wrapping removed lines. --- doc/ScintillaHistory.html | 6 ++++++ src/Editor.cxx | 6 ++++++ 2 files changed, 12 insertions(+) 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 @@ Gary James Tsuyoshi Miyake Martijn Laan + + Pawel Z Wronek

Releases

@@ -601,6 +603,10 @@ Feature #1533.
  • + Fix wrapping removed lines. + Bug #2456. +
  • +
  • On GTK, allow middle click to insert multiple times within a document. Geany Issue #2629.
  • 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(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(); -- cgit v1.2.3