MCPcopy Create free account
hub / github.com/SpartanJ/eepp / foldRegion

Method foldRegion

src/eepp/ui/doc/documentview.cpp:474–487  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

472}
473
474void DocumentView::foldRegion( Int64 foldDocIdx ) {
475 auto foldRegion = mDoc->getFoldRangeService().find( foldDocIdx );
476 if ( !foldRegion )
477 return;
478 if ( isOneToOne() || mDocLineToVisibleIndex.empty() || mVisibleLines.empty() ||
479 mVisibleLinesOffset.empty() )
480 invalidateCache();
481 Int64 toDocIdx = foldRegion->end().line();
482 changeVisibility( foldDocIdx + 1, toDocIdx, false );
483 mFoldedRegions.push_back( *foldRegion );
484 std::sort( mFoldedRegions.begin(), mFoldedRegions.end() );
485 moveCursorToVisibleArea();
486 verifyStructuralConsistency();
487}
488
489void DocumentView::unfoldRegion( Int64 foldDocIdx ) {
490 return unfoldRegion( foldDocIdx, true );

Callers 2

foldMethod · 0.80
toggleFoldUnfoldMethod · 0.80

Calls 6

sortFunction · 0.85
push_backMethod · 0.80
findMethod · 0.45
emptyMethod · 0.45
endMethod · 0.45
beginMethod · 0.45

Tested by

no test coverage detected