MCPcopy Create free account
hub / github.com/SpartanJ/eepp / updateCommandPaletteTable

Method updateCommandPaletteTable

src/tools/ecode/universallocator.cpp:380–410  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

378}
379
380void UniversalLocator::updateCommandPaletteTable() {
381 if ( !mCommandPalette.isSet() )
382 mCommandPalette.setCommandPalette( mApp->getMainLayout()->getCommandList(),
383 mApp->getMainLayout()->getKeyBindings() );
384
385 if ( !mCommandPalette.isEditorSet() && mSplitter->curEditorIsNotNull() )
386 mCommandPalette.setEditorCommandPalette(
387 mSplitter->getCurEditor()->getDocumentRef()->getCommandList(),
388 mSplitter->getCurEditor()->getKeyBindings() );
389
390 mCommandPalette.setCurModel( mSplitter->curEditorIsNotNull() ? mCommandPalette.getEditorModel()
391 : mCommandPalette.getBaseModel() );
392
393 auto txt( mLocateInput->getText() );
394 txt.trim();
395
396 if ( txt.size() > 1 ) {
397 mCommandPalette.asyncFuzzyMatch( txt.substr( 1 ).trim(), 10000, [this]( auto res ) {
398 mUISceneNode->runOnMainThread( [this, res] {
399 mLocateTable->setModel( res );
400 if ( mLocateTable->getModel()->hasChildren() )
401 mLocateTable->getSelection().set( mLocateTable->getModel()->index( 0 ) );
402 mLocateTable->scrollToTop();
403 } );
404 } );
405 } else if ( mCommandPalette.getCurModel() ) {
406 mLocateTable->setModel( mCommandPalette.getCurModel() );
407 if ( mLocateTable->getModel()->hasChildren() )
408 mLocateTable->getSelection().set( mLocateTable->getModel()->index( 0 ) );
409 }
410}
411
412void UniversalLocator::showLocateTable() {
413 mLocateTable->setVisible( true );

Callers

nothing calls this directly

Calls 15

isSetMethod · 0.80
setCommandPaletteMethod · 0.80
getCommandListMethod · 0.80
getMainLayoutMethod · 0.80
isEditorSetMethod · 0.80
curEditorIsNotNullMethod · 0.80
getDocumentRefMethod · 0.80
getCurEditorMethod · 0.80
setCurModelMethod · 0.80
trimMethod · 0.80
asyncFuzzyMatchMethod · 0.80

Tested by

no test coverage detected