diff --git a/bin/assets/plugins/aiassistant.json b/bin/assets/plugins/aiassistant.json index 0f8d649c6..a96f89027 100644 --- a/bin/assets/plugins/aiassistant.json +++ b/bin/assets/plugins/aiassistant.json @@ -474,10 +474,6 @@ "name": "nvidia/nemotron-3-super-120b-a12b:free", "display_name": "NVIDIA: Nemotron 3 Super (free)" }, - { - "name": "qwen/qwen3.6-plus:free", - "display_name": "Qwen: Qwen3.6 Plus (free)" - }, { "name": "minimax/minimax-m2.5:free", "display_name": "MiniMax: MiniMax M2.5 (free)" diff --git a/include/eepp/ui/doc/textdocument.hpp b/include/eepp/ui/doc/textdocument.hpp index 3eb0c5f20..3ca519735 100644 --- a/include/eepp/ui/doc/textdocument.hpp +++ b/include/eepp/ui/doc/textdocument.hpp @@ -620,6 +620,9 @@ class EE_API TextDocument { TextRange addSelections( TextRanges&& selections ); + /* @return returns the selection index otherwise -1 */ + int selectionIndex( TextRange selection ) const; + void popSelection(); bool deleteSelection( const size_t& cursorIdx ); diff --git a/src/eepp/ui/doc/textdocument.cpp b/src/eepp/ui/doc/textdocument.cpp index f94872eeb..ef35edbb7 100644 --- a/src/eepp/ui/doc/textdocument.cpp +++ b/src/eepp/ui/doc/textdocument.cpp @@ -1288,6 +1288,15 @@ TextRange TextDocument::addSelection( TextRange selection ) { return selection; } +int TextDocument::selectionIndex( TextRange selection ) const { + if ( mSelection.exists( selection ) ) + return mSelection.findIndex( selection ); + selection = sanitizeRange( selection ); + if ( mSelection.exists( selection ) ) + return mSelection.findIndex( selection ); + return -1; +} + void TextDocument::popSelection() { mSelection.pop_back(); if ( mLastSelection >= mSelection.size() ) diff --git a/src/tools/ecode/plugins/autocomplete/autocompleteplugin.cpp b/src/tools/ecode/plugins/autocomplete/autocompleteplugin.cpp index e950b36b7..1c79bf9ae 100644 --- a/src/tools/ecode/plugins/autocomplete/autocompleteplugin.cpp +++ b/src/tools/ecode/plugins/autocomplete/autocompleteplugin.cpp @@ -857,18 +857,24 @@ AutoCompletePlugin::processSignatureHelp( const LSPSignatureHelp& signatureHelp doc.textInput( initialLabel ); std::vector parameters; parameters.reserve( sig.parameters.size() ); + int skippedSelections = 0; for ( size_t i = 0; i < sig.parameters.size(); i++ ) { auto start = String::utf8ToCodepointPosition( sig.label, sig.parameters[i].start ); auto end = String::utf8ToCodepointPosition( sig.label, sig.parameters[i].end ); auto sel = TextRange::convertToLineColumn( initialLabel.view(), start, end ); + size_t index = i - skippedSelections; - if ( i == 0 ) + if ( i == 0 ) { doc.setSelection( i, sel ); - else - doc.addSelection( sel ); + } else { + if ( !doc.addSelection( sel ).isValid() ) { + skippedSelections++; + continue; + } + } - parameters.emplace_back( doc.getSelectedText( i ) ); + parameters.emplace_back( doc.getSelectedText( index ) ); } auto selections( doc.getSelections() ); diff --git a/src/tools/ecode/settingsactions.cpp b/src/tools/ecode/settingsactions.cpp index 378717d8f..340225425 100644 --- a/src/tools/ecode/settingsactions.cpp +++ b/src/tools/ecode/settingsactions.cpp @@ -131,6 +131,7 @@ void SettingsActions::aboutEcode() { image->setSize( { 128, 128 } ); image->toBack(); msgBox->setTitle( i18n( "about_ecode", "About ecode..." ) ); + msgBox->setCloseShortcut( { KEY_ESCAPE, 0 } ); msgBox->showWhenReady(); }