- fix: app will become very slow when processing very long lines.

This commit is contained in:
Roy Qu 2022-01-19 23:43:25 +08:00
parent 183efb93c7
commit e161ec42ae
2 changed files with 4 additions and 2 deletions

View File

@ -6,6 +6,7 @@ Red Panda C++ Version 0.13.3
- change: symbols that exactly match are sorted to the front in the code suggestion popup list
- fix: symbols defind locally should be sorted to the front in the code suggestion popup list
- fix: when show function tips, can't correctly calcuate the current position in the function param list
- fix: app will become very slow when processing very long lines.
Red Panda C++ Version 0.13.2
- fix: "delete and exit" button in the environtment / folder option page doesn't work correctly

View File

@ -995,7 +995,7 @@ void SynEditTextPainter::PaintLines()
throw BaseError(SynEdit::tr("The highlighter seems to be in an infinite loop"));
}
}
nTokenColumnsBefore = edit->charToColumn(sLine,edit->mHighlighter->getTokenPos()+1)-1;
//nTokenColumnsBefore = edit->charToColumn(sLine,edit->mHighlighter->getTokenPos()+1)-1;
nTokenColumnLen = edit->stringColumns(sToken, nTokenColumnsBefore);
if (nTokenColumnsBefore + nTokenColumnLen >= vFirstChar) {
if (nTokenColumnsBefore + nTokenColumnLen >= vLastChar) {
@ -1040,11 +1040,12 @@ void SynEditTextPainter::PaintLines()
AddHighlightToken(sToken, nTokenColumnsBefore - (vFirstChar - FirstCol),
nTokenColumnLen, vLine,attr);
}
nTokenColumnsBefore+=nTokenColumnLen;
// Let the highlighter scan the next token.
edit->mHighlighter->next();
}
// Don't assume HL.GetTokenPos is valid after HL.GetEOL == True.
nTokenColumnsBefore += edit->stringColumns(sToken,nTokenColumnsBefore);
//nTokenColumnsBefore += edit->stringColumns(sToken,nTokenColumnsBefore);
if (edit->mHighlighter->eol() && (nTokenColumnsBefore < vLastChar)) {
int lineColumns = edit->mLines->lineColumns(vLine-1);
// Draw text that couldn't be parsed by the highlighter, if any.