aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authornyamatongwe <devnull@localhost>2013-03-18 15:23:08 +1100
committernyamatongwe <devnull@localhost>2013-03-18 15:23:08 +1100
commitd2943f93973d17fa4e174c337555d8c32d13d342 (patch)
treeae60fa9716a327a74615a3ddd2d95407c30bae67 /src
parentd54e3a3ac23da0b6fce2c7fa55cbe22a05cc2aef (diff)
downloadscintilla-mirror-d2943f93973d17fa4e174c337555d8c32d13d342.tar.gz
Bug: [#1455]. Fix unfolding when new line inserted.
Diffstat (limited to 'src')
-rw-r--r--src/Editor.cxx5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/Editor.cxx b/src/Editor.cxx
index f63ceda43..98d98d38f 100644
--- a/src/Editor.cxx
+++ b/src/Editor.cxx
@@ -7005,12 +7005,17 @@ void Editor::EnsureLineVisible(int lineDoc, bool enforcePolicy) {
WrapLines(true, -1);
if (!cs.GetVisible(lineDoc)) {
+ // Back up to find a non-blank line
int lookLine = lineDoc;
int lookLineLevel = pdoc->GetLevel(lookLine);
while ((lookLine > 0) && (lookLineLevel & SC_FOLDLEVELWHITEFLAG)) {
lookLineLevel = pdoc->GetLevel(--lookLine);
}
int lineParent = pdoc->GetFoldParent(lookLine);
+ if (lineParent < 0) {
+ // Backed up to a top level line, so try to find parent of initial line
+ lineParent = pdoc->GetFoldParent(lineDoc);
+ }
if (lineParent >= 0) {
if (lineDoc != lineParent)
EnsureLineVisible(lineParent, enforcePolicy);