Skip to content

Commit

Permalink
allow caching of defined colors
Browse files Browse the repository at this point in the history
  • Loading branch information
sunderme committed Nov 24, 2024
1 parent c50c75e commit 0d3fffc
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/latexdocument.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3533,7 +3533,7 @@ bool LatexDocument::saveCachingData(const QString &folder)

QJsonArray ja_userCommands;
for(const auto &elem:mUserCommandList.values()){
if(elem.name.isEmpty()) continue; // skip empty values
if(elem.name.isEmpty() && elem.snippet.word.isEmpty()) continue; // skip empty values
QJsonArray ja_CommandPair;
ja_CommandPair.append(elem.name);
QString word=elem.snippet.word;
Expand Down Expand Up @@ -3673,7 +3673,10 @@ bool LatexDocument::restoreCachedData(const QString &folder,const QString fileNa
const auto cmd=ja[i].toArray();
UserCommandPair up(cmd[0].toString(),cmd[1].toString());
mUserCommandList.insert(nullptr,up);
ltxCommands.possibleCommands["user"].insert(cmd[1].toString());
if(!cmd[0].toString().isEmpty()){
// only named commands are added for syntax checking
ltxCommands.possibleCommands["user"].insert(cmd[1].toString());
}
}
ja=dd.value("packages").toArray();
const bool addedPackages=ja.size()>0;
Expand Down

0 comments on commit 0d3fffc

Please sign in to comment.