Basic debugging working.

This commit is contained in:
Martín Lucas Golini
2025-01-04 15:43:54 -03:00
parent c4bd88461d
commit df65ec78c3
18 changed files with 456 additions and 157 deletions

View File

@@ -590,7 +590,7 @@ void UniversalLocator::initLocateBar( UILocateBar* locateBar, UITextInput* locat
range = { pathAndPos.second, pathAndPos.second };
}
focusOrLoadFile( path, range );
mApp->focusOrLoadFile( path, range );
mLocateBarLayout->execute( "close-locatebar" );
}
} );
@@ -761,27 +761,6 @@ std::shared_ptr<FileListModel> UniversalLocator::openDocumentsModel( const std::
return std::make_shared<FileListModel>( std::move( ffiles ), std::move( fnames ) );
}
void UniversalLocator::focusOrLoadFile( const std::string& path, const TextRange& range ) {
UITab* tab = mSplitter->isDocumentOpen( path, true );
if ( !tab ) {
FileInfo fileInfo( path );
if ( fileInfo.exists() && fileInfo.isRegularFile() )
mApp->loadFileFromPath(
path, true, nullptr, [this, range]( UICodeEditor* editor, auto ) {
if ( range.isValid() ) {
editor->goToLine( range.start() );
mSplitter->addEditorPositionToNavigationHistory( editor );
}
} );
} else {
tab->getTabWidget()->setTabSelected( tab );
if ( range.isValid() ) {
UICodeEditor* editor = tab->getOwnedWidget()->asType<UICodeEditor>();
editor->goToLine( range.start() );
mSplitter->addEditorPositionToNavigationHistory( editor );
}
}
}
void UniversalLocator::updateOpenDocumentsTable() {
mLocateTable->setModel(