aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorNeil <nyamatongwe@gmail.com>2017-01-19 21:31:35 +1100
committerNeil <nyamatongwe@gmail.com>2017-01-19 21:31:35 +1100
commit21bc1deb34f2ba2a4514d54efa3b6d2a25a83deb (patch)
treee87c1a888f9daa0912bc71b43b4cf18941856348
parent0cccd1e6285dce657e7106cc3ea0cd090a772860 (diff)
downloadscintilla-mirror-21bc1deb34f2ba2a4514d54efa3b6d2a25a83deb.tar.gz
Bug [#1896]. Avoid unnecessary unfolding when a deletion does not include a line
end.
-rw-r--r--doc/ScintillaHistory.html1
-rw-r--r--src/Editor.cxx4
2 files changed, 3 insertions, 2 deletions
diff --git a/doc/ScintillaHistory.html b/doc/ScintillaHistory.html
index 1236efd7d..58743678e 100644
--- a/doc/ScintillaHistory.html
+++ b/doc/ScintillaHistory.html
@@ -539,6 +539,7 @@
</li>
<li>
Fix folding inconsistency when fold header added above a folded part.
+ Avoid unnecessary unfolding when a deletion does not include a line end.
<a href="http://sourceforge.net/p/scintilla/bugs/1896/">Bug #1896</a>.
</li>
<li>
diff --git a/src/Editor.cxx b/src/Editor.cxx
index 29f0681fd..a2b087046 100644
--- a/src/Editor.cxx
+++ b/src/Editor.cxx
@@ -2611,10 +2611,10 @@ void Editor::NotifyModified(Document *, DocModification mh, void *) {
if (pdoc->ContainsLineEnd(mh.text, mh.length) && (mh.position != pdoc->LineStart(lineOfPos)))
endNeedShown = pdoc->LineStart(lineOfPos+1);
} else if (mh.modificationType & SC_MOD_BEFOREDELETE) {
- // Extend the need shown area over any folded lines
+ // If the deletion includes any EOL then we extend the need shown area.
endNeedShown = mh.position + mh.length;
int lineLast = pdoc->LineFromPosition(mh.position+mh.length);
- for (int line = lineOfPos; line <= lineLast; line++) {
+ for (int line = lineOfPos + 1; line <= lineLast; line++) {
const int lineMaxSubord = pdoc->GetLastChild(line, -1, -1);
if (lineLast < lineMaxSubord) {
lineLast = lineMaxSubord;