- fix: columns calculation not correct when paint lines containing chinese characters

This commit is contained in:
Roy Qu 2021-11-22 19:10:56 +08:00
parent 69ba84fc86
commit dda0f82b4d
6 changed files with 7 additions and 16 deletions

View File

@ -1,5 +1,6 @@
Version 0.9.3 For Dev-C++ 7 Beta
- fix: the count in the title of issues view isn't correct
- fix: columns calculation not correct when paint lines containing chinese characters
Version 0.9.2 For Dev-C++ 7 Beta
- fix: gutter of the disassembly code control in the cpu info dialog is grayed

View File

@ -876,7 +876,6 @@ void Editor::onPreparePaintHighlightToken(int line, int aChar, const QString &to
if (token.isEmpty())
return;
// qDebug()<<token<<"-"<<attr->name()<<" - "<<line<<" : "<<aChar;
if (mParser && highlighter() && (attr == highlighter()->identifierAttribute())) {
BufferCoord p{aChar,line};
BufferCoord pBeginPos,pEndPos;

View File

@ -5695,16 +5695,6 @@ void MainWindow::on_actionProblem_triggered()
showHideMessagesTab(ui->tabProblem,state);
}
void MainWindow::on_actionInsert_Line_triggered()
{
Editor *e=mEditorList->getEditor();
if (e) {
e->insertLine();
}
}
void MainWindow::on_actionDelete_Line_triggered()
{
Editor *e=mEditorList->getEditor();
@ -5713,7 +5703,6 @@ void MainWindow::on_actionDelete_Line_triggered()
}
}
void MainWindow::on_actionDuplicate_Line_triggered()
{
Editor *e=mEditorList->getEditor();

View File

@ -518,8 +518,6 @@ private slots:
void on_actionProblem_triggered();
void on_actionInsert_Line_triggered();
void on_actionDelete_Line_triggered();
void on_actionDuplicate_Line_triggered();

View File

@ -250,6 +250,10 @@ void SynEdit::setCaretXYEx(bool CallEnsureCursorPos, BufferCoord value)
invalidateLine(mCaretY);
invalidateLine(oldCaretY);
}
if (mGutter.activeLineTextColor().isValid()) {
invalidateGutterLine(mCaretY);
invalidateGutterLine(oldCaretY);
}
mStatusChanges.setFlag(SynStatusChange::scCaretY);
}
// Call UpdateLastCaretX before DecPaintLock because the event handler it
@ -829,7 +833,7 @@ int SynEdit::columnToChar(int aLine, int aColumn) const
int SynEdit::stringColumns(const QString &line, int colsBefore) const
{
int columns = colsBefore;
int columns = std::max(0,colsBefore);
int charCols;
for (int i=0;i<line.length();i++) {
QChar ch = line[i];

View File

@ -995,7 +995,7 @@ void SynEditTextPainter::PaintLines()
edit->mHighlighter->next();
}
// Don't assume HL.GetTokenPos is valid after HL.GetEOL == True.
nTokenColumnsBefore += edit->stringColumns(sToken,nTokenColumnsBefore-1);
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.