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

Method addCursorsFromCurrentToMousePosition

src/eepp/ui/uicodeeditor.cpp:1644–1657  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1642}
1643
1644void UICodeEditor::addCursorsFromCurrentToMousePosition() {
1645 auto position = getInput()->getMousePos();
1646 auto textScreenPos( resolveScreenPosition( position.asFloat() ) );
1647 TextRange range( mDoc->getSelection().start(), textScreenPos );
1648 range = mDoc->sanitizeRange( range );
1649 TextRange nrange = range.normalized();
1650 TextRanges ranges;
1651 ranges.reserve( nrange.end().line() - nrange.start().line() + 1 );
1652 for ( Int64 i = nrange.start().line(); i <= nrange.end().line(); ++i ) {
1653 TextPosition pos{ i, range.start().column() };
1654 ranges.push_back( TextRange{ pos, pos } );
1655 }
1656 mDoc->addSelections( std::move( ranges ) );
1657}
1658
1659bool UICodeEditor::fold( Int64 docLineIdx ) {
1660 if ( mDoc->getFoldRangeService().isFoldingRegionInLine( docLineIdx ) ) {

Callers 1

registerCommandsMethod · 0.80

Calls 11

sanitizeRangeMethod · 0.80
normalizedMethod · 0.80
reserveMethod · 0.80
columnMethod · 0.80
push_backMethod · 0.80
addSelectionsMethod · 0.80
getMousePosMethod · 0.45
asFloatMethod · 0.45
startMethod · 0.45
getSelectionMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected