Skip to content

Commit

Permalink
remove obsolete speccialDef commands
Browse files Browse the repository at this point in the history
  • Loading branch information
sunderme committed Nov 2, 2023
1 parent be5fff7 commit 3c8c7fd
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion src/latexdocument.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1211,7 +1211,19 @@ void LatexDocument::removeLineElements(QDocumentLineHandle *dlh, HandledData &ch
mIncludedFilesList.remove(dlh);
mImportedFilesList.remove(dlh);

if (mUserCommandList.remove(dlh) > 0) changedCommands.completerNeedsUpdate = true;
if (mUserCommandList.count(dlh) > 0) {
changedCommands.completerNeedsUpdate = true;
foreach (const UserCommandPair &cmd, mUserCommandList.values(dlh)) {
QString elem = cmd.snippet.word;
if (elem.startsWith("%")) { // insert specialArgs
int i = elem.indexOf('%', 1);
QString category = elem.left(i);
elem = elem.mid(i + 1);
ltxCommands.possibleCommands[category].remove(elem);
}
}
mUserCommandList.remove(dlh);
}
if (mBibItem.remove(dlh))
changedCommands.bibTeXFilesNeedsUpdate = true;

Expand Down

0 comments on commit 3c8c7fd

Please sign in to comment.