mirror of
https://github.com/SpartanJ/eepp.git
synced 2026-05-29 17:46:29 +03:00
Fixed auto close bracket selection in ecode.
Added swift lang support.
This commit is contained in:
@@ -1366,14 +1366,16 @@ UIMenu* App::createDocumentMenu() {
|
||||
->setOnShouldCloseCb( shouldCloseCb )
|
||||
->setId( "``" );
|
||||
bracketsMenu->addEventListener( Event::OnItemClicked, [&]( const Event* event ) {
|
||||
const String& id = event->getNode()->getId();
|
||||
std::string id = event->getNode()->getId();
|
||||
if ( event->getNode()->isType( UI_TYPE_MENUCHECKBOX ) ) {
|
||||
UIMenuCheckBox* item = event->getNode()->asType<UIMenuCheckBox>();
|
||||
auto curPairs = String::split( mConfig.editor.autoCloseBrackets, ',' );
|
||||
auto found = std::find( curPairs.begin(), curPairs.end(), id );
|
||||
if ( item->isActive() ) {
|
||||
auto found = std::find( curPairs.begin(), curPairs.end(), id );
|
||||
if ( found == curPairs.end() )
|
||||
curPairs.push_back( id );
|
||||
} else if ( found != curPairs.end() ) {
|
||||
curPairs.erase( found );
|
||||
}
|
||||
mConfig.editor.autoCloseBrackets = String::join( curPairs, ',' );
|
||||
auto pairs = makeAutoClosePairs( mConfig.editor.autoCloseBrackets );
|
||||
|
||||
Reference in New Issue
Block a user