Skip to content

Commit

Permalink
handle special def better on line removal
Browse files Browse the repository at this point in the history
  • Loading branch information
sunderme committed Nov 4, 2023
1 parent 195dc42 commit ec4bdaf
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions src/latexdocument.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -274,9 +274,17 @@ void LatexDocument::patchStructureRemoval(QDocumentLineHandle *dlh, int hint,int
}
}
}else{
int i = word.indexOf("{");
if (i >= 0) word = word.left(i);
ltxCommands.possibleCommands["user"].remove(word);
if(word.startsWith("%")){
int i = word.indexOf('%', 1);
QString category = word.left(i);
QString elem = word.mid(i + 1);
lp->possibleCommands[category].remove(elem);
ltxCommands.possibleCommands[category].remove(elem);
}else{
int i = word.indexOf("{");
if (i >= 0) word = word.left(i);
ltxCommands.possibleCommands["user"].remove(word);
}
}
updateSyntaxCheck = true;
}
Expand Down

0 comments on commit ec4bdaf

Please sign in to comment.