Try a different logic for the alt+shift cursor creation, always create cursors in the initial cursor column (SpartanJ/ecode#356).

This commit is contained in:
Martín Lucas Golini
2024-11-08 14:24:15 -03:00
parent 87c566b3b0
commit 82f015a31f

View File

@@ -1409,11 +1409,11 @@ Uint32 UICodeEditor::onMouseDown( const Vector2i& position, const Uint32& flags
}
} else if ( input->isModState( KEYMOD_LALT | KEYMOD_SHIFT ) ) {
TextRange range( mDoc->getSelection().start(), textScreenPos );
range.normalize();
range = mDoc->sanitizeRange( range );
TextRange nrange = range.normalized();
TextRanges ranges;
ranges.reserve( range.end().line() - range.start().line() + 1 );
for ( Int64 i = range.start().line(); i <= range.end().line(); ++i ) {
ranges.reserve( nrange.end().line() - nrange.start().line() + 1 );
for ( Int64 i = nrange.start().line(); i <= nrange.end().line(); ++i ) {
TextPosition pos{ i, range.start().column() };
ranges.push_back( TextRange{ pos, pos } );
}