mirror of
https://github.com/SpartanJ/eepp.git
synced 2026-06-04 20:46:29 +03:00
Optimize multiple cursors selection (issue SpartanJ/ecode#356).
This commit is contained in:
@@ -1411,8 +1411,13 @@ Uint32 UICodeEditor::onMouseDown( const Vector2i& position, const Uint32& flags
|
||||
TextRange range( mDoc->getSelection().start(), textScreenPos );
|
||||
range.normalize();
|
||||
range = mDoc->sanitizeRange( range );
|
||||
for ( Int64 i = range.start().line(); i < range.end().line(); ++i )
|
||||
mDoc->addSelection( { i, range.start().column() } );
|
||||
TextRanges ranges;
|
||||
ranges.reserve( range.end().line() - range.start().line() + 1 );
|
||||
for ( Int64 i = range.start().line(); i < range.end().line(); ++i ) {
|
||||
TextPosition pos{ i, range.start().column() };
|
||||
ranges.push_back( TextRange{ pos, pos } );
|
||||
}
|
||||
mDoc->addSelections( std::move( ranges ) );
|
||||
} else if ( input->isModState( KEYMOD_SHIFT ) ) {
|
||||
mDoc->selectTo( textScreenPos );
|
||||
} else if ( input->isModState( KEYMOD_CTRL ) &&
|
||||
|
||||
@@ -8,7 +8,7 @@ using namespace EE;
|
||||
|
||||
#define ECODE_MAJOR_VERSION 0
|
||||
#define ECODE_MINOR_VERSION 6
|
||||
#define ECODE_PATCH_LEVEL 3
|
||||
#define ECODE_PATCH_LEVEL 4
|
||||
/* ECODE_COMMIT_NUMBER 9999 is used for official releases, nightly builds (pre-releases) will
|
||||
* contain the number of commits after the last official release
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user