Do not copy the whole SyntaxDefinition into TextDocument but instead keep the shared pointer to the definition.

Did some minor SyntaxDefinition memory access safety improvements.
In breeze color scheme definition renamed `--win-icon` to `--icon-line` and removed `--scroll-button` since it was not being used.
This commit is contained in:
Martín Lucas Golini
2026-01-17 00:19:51 -03:00
parent a8cde70eb1
commit cf6c14fbda
8 changed files with 137 additions and 121 deletions

View File

@@ -4700,13 +4700,11 @@ static void exportLanguages( const std::string& path, const std::string& langs,
SyntaxDefinitionManager::instance()->loadFromFolder( langsPath );
std::vector<SyntaxDefinition> defs;
for ( auto& preDef : sdm->getPreDefinitions() )
preDef.load();
sdm->forEachPreDefinition( []( auto preDef ) { preDef.load(); } );
if ( !langs.empty() ) {
if ( langs == "all" ) {
for ( const auto& def : sdm->getDefinitions() )
defs.push_back( *def.get() );
sdm->forEachDefinition( [&defs]( auto def ) { defs.push_back( *def.get() ); } );
} else {
auto langss = String::split( langs, ',' );
for ( const auto& l : langss ) {