fix: imported patterns used for inheritance were not highlighted. (#2356)

The problem was that imported files didn't have token sequences to
obtain the UDT variables. The fix was to create maps from the file name
to the token sequence and then process each imported file to obtain all
the variables needed. Function variables are skipped since they can be
part of the code.
There are also some minor code style corrections and a fix in the text
editor where the last line of a selection was not being deleted.
This commit is contained in:
paxcut
2025-07-25 12:16:02 -07:00
committed by GitHub
parent 68804a357d
commit 8f3d07ea69
4 changed files with 93 additions and 98 deletions

View File

@@ -257,10 +257,12 @@ void TextEditor::DeleteRange(const Coordinates &aStart, const Coordinates &aEnd)
auto &firstLine = mLines[start.mLine];
auto &lastLine = mLines[end.mLine];
if (startIndex < (int)firstLine.size())
if (startIndex <= (int)firstLine.size())
firstLine.erase(firstLine.begin() + startIndex, -1);
if (endIndex < (int)lastLine.size())
if (endIndex <= (int)lastLine.size())
lastLine.erase(lastLine.begin(), endIndex);
else
lastLine.erase(lastLine.begin(), -1);
if (!lastLine.empty()) {
firstLine.insert(firstLine.end(), lastLine.begin(), lastLine.end());