diff options
author | nyamatongwe <devnull@localhost> | 2013-03-18 15:23:08 +1100 |
---|---|---|
committer | nyamatongwe <devnull@localhost> | 2013-03-18 15:23:08 +1100 |
commit | d2943f93973d17fa4e174c337555d8c32d13d342 (patch) | |
tree | ae60fa9716a327a74615a3ddd2d95407c30bae67 | |
parent | d54e3a3ac23da0b6fce2c7fa55cbe22a05cc2aef (diff) | |
download | scintilla-mirror-d2943f93973d17fa4e174c337555d8c32d13d342.tar.gz |
Bug: [#1455]. Fix unfolding when new line inserted.
-rw-r--r-- | src/Editor.cxx | 5 |
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); |