From 64794b785942d9396b4365fbf961c9ba3a7f0c69 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mart=C3=ADn=20Lucas=20Golini?= Date: Sun, 22 Mar 2026 17:38:51 -0300 Subject: [PATCH] Fix `SyntaxHighlighter::tokenizeAsync` (damn i pushed a temporal change into develop). Fix duplicating the load of session snapshot temporal files. --- src/eepp/ui/doc/syntaxhighlighter.cpp | 2 +- src/tools/ecode/appconfig.cpp | 9 +++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/src/eepp/ui/doc/syntaxhighlighter.cpp b/src/eepp/ui/doc/syntaxhighlighter.cpp index 43de79416..97a7f06d2 100644 --- a/src/eepp/ui/doc/syntaxhighlighter.cpp +++ b/src/eepp/ui/doc/syntaxhighlighter.cpp @@ -132,7 +132,7 @@ void SyntaxHighlighter::setMaxTokenizationLength( const Int64& maxTokenizationLe void SyntaxHighlighter::tokenizeAsync( std::shared_ptr pool, const std::function& onDone ) { - if ( mTokenizeAsync && false ) + if ( mTokenizeAsync ) return; mTokenizeAsync = true; pool->run( [this, onDone] { diff --git a/src/tools/ecode/appconfig.cpp b/src/tools/ecode/appconfig.cpp index 1538a2b87..41ef068b9 100644 --- a/src/tools/ecode/appconfig.cpp +++ b/src/tools/ecode/appconfig.cpp @@ -732,6 +732,15 @@ void AppConfig::loadDocuments( UICodeEditorSplitter* editorSplitter, json j, editorLoadedCounter( app ); } else { + auto isSnapshotFile = + std::find_if( sessionSnapshotFiles.begin(), sessionSnapshotFiles.end(), + [&path]( const SessionSnapshotFile& file ) { + return file.cachePath == path; + } ); + + if ( isSnapshotFile != sessionSnapshotFiles.end() ) + return; // snapshot files are loaded later + editorSplitter->loadAsyncFileFromPathInNewTab( path, [this, curTabWidget, selection, totalToLoad, currentPage, app, path,