Skip to content

Commit 1b4f9b9

Browse files
committed
handle specialdef better when changing packages
1 parent 0700fc7 commit 1b4f9b9

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/latexdocument.cpp

+8
Original file line numberDiff line numberDiff line change
@@ -2830,6 +2830,11 @@ bool LatexDocument::updateCompletionFiles(const bool updatePackages, const bool
28302830
if(updatePackages){
28312831
QSet<QString> userCommands=ltxCommands.possibleCommands["user"]; // keep user commands
28322832
QSet<QString> columnCommands=ltxCommands.possibleCommands["%columntypes"];
2833+
QHash<QString, QSet<QString> > cacheCommands;
2834+
cacheCommands["%color"]=ltxCommands.possibleCommands["%color"];
2835+
for(const QString &key:lp->mapSpecialArgs.values()){
2836+
cacheCommands[key]=ltxCommands.possibleCommands[key];
2837+
}
28332838

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

28552860
ltxCommands.possibleCommands["user"] = userCommands;// keep user commands
28562861
ltxCommands.possibleCommands["%columntypes"] = columnCommands;
2862+
for(const QString &key:cacheCommands.keys()){
2863+
ltxCommands.possibleCommands[key].unite(cacheCommands[key]);
2864+
}
28572865
}
28582866
if(updateUserCommands){
28592867
// user commands

0 commit comments

Comments
 (0)