Skip to content

Commit 43dc893

Browse files
committed
clean up command stack if an argument is closed
fix #3292
1 parent 7b409a5 commit 43dc893

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/latexparser/latexparsing.cpp

+4
Original file line numberDiff line numberDiff line change
@@ -582,6 +582,10 @@ bool latexDetermineContexts2(QDocumentLineHandle *dlh, TokenStack &stack, Comman
582582
tk.subtype=tk1.subtype;
583583
level=tk1.level; // restore original level
584584
lexed.append(tk);
585+
// clean up command stack (unrealized arguments)
586+
while (!commandStack.isEmpty() && commandStack.top().level > level) {
587+
commandStack.pop();
588+
}
585589
}
586590
if (!commandStack.isEmpty() && commandStack.top().level == level) {
587591
CommandDescription cd = commandStack.top();

0 commit comments

Comments
 (0)