Skip to content

Commit

Permalink
clean up command stack if an argument is closed
Browse files Browse the repository at this point in the history
fix #3292
  • Loading branch information
sunderme committed Nov 7, 2023
1 parent 7b409a5 commit 43dc893
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/latexparser/latexparsing.cpp
Original file line number Diff line number Diff line change
@@ -582,6 +582,10 @@ bool latexDetermineContexts2(QDocumentLineHandle *dlh, TokenStack &stack, Comman
tk.subtype=tk1.subtype;
level=tk1.level; // restore original level
lexed.append(tk);
// clean up command stack (unrealized arguments)
while (!commandStack.isEmpty() && commandStack.top().level > level) {
commandStack.pop();
}
}
if (!commandStack.isEmpty() && commandStack.top().level == level) {
CommandDescription cd = commandStack.top();

0 comments on commit 43dc893

Please sign in to comment.