From 82f015a31ffa63bb596a8f3f3425dd38ed970c81 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mart=C3=ADn=20Lucas=20Golini?= Date: Fri, 8 Nov 2024 14:24:15 -0300 Subject: [PATCH] Try a different logic for the alt+shift cursor creation, always create cursors in the initial cursor column (SpartanJ/ecode#356). --- src/eepp/ui/uicodeeditor.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/eepp/ui/uicodeeditor.cpp b/src/eepp/ui/uicodeeditor.cpp index 825f0e0b5..abac9502e 100644 --- a/src/eepp/ui/uicodeeditor.cpp +++ b/src/eepp/ui/uicodeeditor.cpp @@ -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 } ); }