IME fixes that should fix SpartanJ/ecode#355.

Fix a crash when loading empty file from disk.
This commit is contained in:
Martín Lucas Golini
2024-11-15 00:07:40 -03:00
parent 8242274059
commit 889ba51a2e
3 changed files with 10 additions and 4 deletions
+4 -1
View File
@@ -755,7 +755,10 @@ void AppConfig::loadProject( std::string projectFolder, UICodeEditorSplitter* ed
editorSplitter->loadAsyncFileFromPathInNewTab(
snapshotFile.cachePath,
[snapshotFile]( UICodeEditor* editor, const std::string& ) {
[snapshotFile, editorSplitter]( UICodeEditor* editor, const std::string& ) {
// Editor could have been closed right after load
if ( !editorSplitter->editorExists( editor ) )
return;
TextDocument& doc = editor->getDocument();
auto selection = TextRange::fromString( snapshotFile.selection );
doc.setDefaultFileName( snapshotFile.name );