MCPcopy Create free account
hub / github.com/ProgerXP/Notepad2e / FoldChanged

Method FoldChanged

scintilla/src/Editor.cxx:7296–7328  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

7294}
7295
7296void Editor::FoldChanged ( int line, int levelNow, int levelPrev )
7297{
7298 if ( levelNow & SC_FOLDLEVELHEADERFLAG ) {
7299 if ( ! ( levelPrev & SC_FOLDLEVELHEADERFLAG ) ) {
7300 // Adding a fold point.
7301 if ( cs.SetExpanded ( line, true ) ) {
7302 RedrawSelMargin();
7303 }
7304 FoldExpand ( line, SC_FOLDACTION_EXPAND, levelPrev );
7305 }
7306 } else if ( levelPrev & SC_FOLDLEVELHEADERFLAG ) {
7307 if ( !cs.GetExpanded ( line ) ) {
7308 // Removing the fold from one that has been contracted so should expand
7309 // otherwise lines are left invisible with no way to make them visible
7310 if ( cs.SetExpanded ( line, true ) ) {
7311 RedrawSelMargin();
7312 }
7313 FoldExpand ( line, SC_FOLDACTION_EXPAND, levelPrev );
7314 }
7315 }
7316 if ( ! ( levelNow & SC_FOLDLEVELWHITEFLAG ) &&
7317 ( ( levelPrev & SC_FOLDLEVELNUMBERMASK ) > ( levelNow & SC_FOLDLEVELNUMBERMASK ) ) ) {
7318 if ( cs.HiddenLines() ) {
7319 // See if should still be hidden
7320 int parentLine = pdoc->GetFoldParent ( line );
7321 if ( ( parentLine < 0 ) || ( cs.GetExpanded ( parentLine ) && cs.GetVisible ( parentLine ) ) ) {
7322 cs.SetVisible ( line, line, true );
7323 SetScrollBars();
7324 Redraw();
7325 }
7326 }
7327 }
7328}
7329
7330void Editor::NeedShown ( int pos, int len )
7331{

Callers

nothing calls this directly

Calls 6

SetExpandedMethod · 0.80
HiddenLinesMethod · 0.80
GetFoldParentMethod · 0.80
GetVisibleMethod · 0.80
SetVisibleMethod · 0.80
GetExpandedMethod · 0.45

Tested by

no test coverage detected