Skip to content
Extraits de code Groupes Projets
Valider e43b81bd rédigé par Kubat's avatar Kubat Validation de Elliu
Parcourir les fichiers

FIX: ScriptView: no more segv in vim edition mode

When the editor was in vim mode, a failure in a vim command (:w or :wq)
triggered std::terminate because a lambda that was declared as noexcept
invoked to save threw an std::runtime_error. Use the same try/catch
block from the MainWindow in the ScriptDocumentView when we use the fake
vim editor.
parent 54f13a63
Aucune branche associée trouvée
Aucune étiquette associée trouvée
1 requête de fusion!29Improve timingView with display of the ASS lines
......@@ -56,10 +56,20 @@ ScriptDocumentView::setUseFakeVimEditor(bool yes) noexcept
connect(proxy, &EditorProxy::requestQuit, this, [this, mw]() noexcept -> void {
mw->closeDocument(static_cast<AbstractDocumentView *>(this));
});
connect(proxy, &EditorProxy::requestSave, this, [this]() { document->save(); });
connect(proxy, &EditorProxy::requestSave, this, [this]() noexcept -> void {
try {
document->save();
} catch (const std::runtime_error &e) {
logError() << "Failed to save current document: " << e.what();
}
});
connect(proxy, &EditorProxy::requestSaveAndQuit, this, [this, mw]() noexcept -> void {
document->save();
mw->closeDocument(static_cast<AbstractDocumentView *>(this));
try {
document->save();
mw->closeDocument(static_cast<AbstractDocumentView *>(this));
} catch (const std::runtime_error &e) {
logError() << "Failed to save current document and close it: " << e.what();
}
});
initHandler(handler);
clearUndoRedo(editor);
......
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Veuillez vous inscrire ou vous pour commenter