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

Method moveToStartOfContent

src/eepp/ui/uicodeeditor.cpp:3572–3587  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3570}
3571
3572void UICodeEditor::moveToStartOfContent() {
3573 for ( size_t i = 0; i < mDoc->getSelections().size(); ++i ) {
3574 TextPosition start = mDoc->getSelectionIndex( i ).start();
3575 auto info = mDocView.getVisibleLineRange( start );
3576 if ( info.range.start().column() != 0 ) {
3577 mDoc->setSelection( i, info.range.start() != start ? info.range.start()
3578 : mDoc->startOfContent( start ) );
3579 } else {
3580 TextPosition indented = mDoc->startOfContent( mDoc->getSelectionIndex( i ).start() );
3581 mDoc->setSelection( i, indented.column() == start.column()
3582 ? TextPosition( start.line(), 0 )
3583 : indented );
3584 }
3585 }
3586 mDoc->mergeSelection();
3587}
3588
3589void UICodeEditor::selectToStartOfLine() {
3590 for ( size_t i = 0; i < mDoc->getSelections().size(); ++i ) {

Callers 1

registerCommandsMethod · 0.45

Calls 9

TextPositionFunction · 0.85
getSelectionIndexMethod · 0.80
columnMethod · 0.80
startOfContentMethod · 0.80
mergeSelectionMethod · 0.80
sizeMethod · 0.45
startMethod · 0.45
getVisibleLineRangeMethod · 0.45
setSelectionMethod · 0.45

Tested by

no test coverage detected