Skip to content

Commit

Permalink
handle specialdef better when changing packages
Browse files Browse the repository at this point in the history
  • Loading branch information
sunderme committed Nov 2, 2023
1 parent 0700fc7 commit 1b4f9b9
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/latexdocument.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2830,6 +2830,11 @@ bool LatexDocument::updateCompletionFiles(const bool updatePackages, const bool
if(updatePackages){
QSet<QString> userCommands=ltxCommands.possibleCommands["user"]; // keep user commands
QSet<QString> columnCommands=ltxCommands.possibleCommands["%columntypes"];
QHash<QString, QSet<QString> > cacheCommands;
cacheCommands["%color"]=ltxCommands.possibleCommands["%color"];
for(const QString &key:lp->mapSpecialArgs.values()){
cacheCommands[key]=ltxCommands.possibleCommands[key];
}

QStringList files = mUsepackageList.values();
LatexParser &latexParser = LatexParser::getInstance();
Expand All @@ -2854,6 +2859,9 @@ bool LatexDocument::updateCompletionFiles(const bool updatePackages, const bool

ltxCommands.possibleCommands["user"] = userCommands;// keep user commands
ltxCommands.possibleCommands["%columntypes"] = columnCommands;
for(const QString &key:cacheCommands.keys()){
ltxCommands.possibleCommands[key].unite(cacheCommands[key]);
}
}
if(updateUserCommands){
// user commands
Expand Down

0 comments on commit 1b4f9b9

Please sign in to comment.