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

Method jumpLinesDown

src/eepp/ui/uicodeeditor.cpp:3639–3650  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3637}
3638
3639void UICodeEditor::jumpLinesDown( int offset ) {
3640 for ( size_t i = 0; i < mDoc->getSelections().size(); ++i ) {
3641 TextPosition position = mDoc->getSelections()[i].start();
3642 Int64 visibleIndex = static_cast<Int64>( mDocView.getVisibleLineInfo( i ).visibleIndex );
3643 if ( visibleIndex >= (Int64)mDocView.getVisibleLinesCount() - offset ) {
3644 mDoc->setSelection( i, mDoc->endOfDoc(), mDoc->endOfDoc() );
3645 } else {
3646 mDoc->moveTo( i, moveToLineOffset( position, offset, i ) );
3647 }
3648 }
3649 mDoc->mergeSelection();
3650}
3651
3652void UICodeEditor::jumpLinesUp() {
3653 jumpLinesDown( -mJumpLinesLength );

Callers 1

createCodeEditorMethod · 0.80

Calls 8

getVisibleLineInfoMethod · 0.80
endOfDocMethod · 0.80
moveToMethod · 0.80
mergeSelectionMethod · 0.80
sizeMethod · 0.45
startMethod · 0.45
getVisibleLinesCountMethod · 0.45
setSelectionMethod · 0.45

Tested by

no test coverage detected