Fix: When build is triggered with unsaved files don't display the file save dialog for files that are just in text buffer.

Fix: Ctrl+W does not close the tab in Build Settings: Added Event::OnFocusWithin so the tab widget registers that event to setCurrenWidget in UICodeEditorSplitter.
This commit is contained in:
Martín Lucas Golini
2026-05-18 01:08:14 -03:00
parent 8cfedc4590
commit 97fc336955
11 changed files with 43 additions and 21 deletions
+7 -8
View File
@@ -186,10 +186,10 @@ void App::saveAllProcess() {
} );
}
void App::saveAll() {
void App::saveAll( bool includeBuffers ) {
mTmpDocs.clear();
mSplitter->forEachEditor( [this]( UICodeEditor* editor ) {
if ( editor->isDirty() )
mSplitter->forEachEditor( [&]( UICodeEditor* editor ) {
if ( editor->isDirty() && ( includeBuffers || editor->getDocument().hasFilepath() ) )
mTmpDocs.insert( &editor->getDocument() );
} );
saveAllProcess();
@@ -1739,8 +1739,8 @@ void App::onTabCreated( UITab* tab, UIWidget* ) {
menuAdd( "open_containing_folder_in_fm", "Open Containing Folder in File Manager",
"folder-open", "open-containing-folder" );
menuAdd( "copy_containing_folder_path", "Copy Containing Folder Path",
"copy", "copy-containing-folder-path" );
menuAdd( "copy_containing_folder_path", "Copy Containing Folder Path", "copy",
"copy-containing-folder-path" );
menuAdd( "copy_file_path", "Copy File Path", "copy", "copy-file-path" );
@@ -3273,9 +3273,8 @@ void App::onCodeEditorCreated( UICodeEditor* editor, TextDocument& doc ) {
} );
mdView->loadFromString( doc->toUtf8String() );
auto title =
i18n( "markdown_live_preview_colon", "Markdown Live Preview:" ) + " " +
doc->getFilename();
auto title = i18n( "markdown_live_preview_colon", "Markdown Live Preview:" ) +
" " + doc->getFilename();
auto [tab, _] =
getSplitter()->createWidgetInTabWidget( tabWidget, scrollView, title );
tab->setIcon( findIcon( "filetype-md" ) );