Skip to content

Commit

Permalink
fix #3403
Browse files Browse the repository at this point in the history
  • Loading branch information
sunderme committed Dec 5, 2023
1 parent ca1704a commit d6ee2b3
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/latexdocument.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1036,6 +1036,9 @@ void LatexDocument::interpretCommandArguments(QDocumentLineHandle *dlh, const in
CodeSnippet cs(txt,true,true);
cs.type=CodeSnippet::userConstruct;
mUserCommandList.insert(dlh, UserCommandPair(QString(), cs));
if (!data.removedUserCommands.removeAll(txt)) {
data.addedUserCommands << txt;
}
}
}
/// auto user commands of \mathcmd{one arg} e.g. \mathsf{abc} or \overbrace{abc}
Expand All @@ -1047,6 +1050,9 @@ void LatexDocument::interpretCommandArguments(QDocumentLineHandle *dlh, const in
CodeSnippet cs(txt,true,true);
cs.type=CodeSnippet::userConstruct;
mUserCommandList.insert(dlh, UserCommandPair(QString(), cs));
if (!data.removedUserCommands.removeAll(txt)) {
data.addedUserCommands << txt;
}
}
}
}
Expand Down Expand Up @@ -1922,7 +1928,7 @@ QList<CodeSnippet> LatexDocument::userCommandList() const
{
QList<CodeSnippet> csl;
foreach (UserCommandPair cmd, mUserCommandList) {
if(cmd.name.isEmpty()) continue; // filter out special def
if(cmd.name.isEmpty() && cmd.snippet.type!=CodeSnippet::userConstruct) continue; // filter out special def
csl.append(cmd.snippet);
}
std::sort(csl.begin(),csl.end());
Expand Down

0 comments on commit d6ee2b3

Please sign in to comment.