- fix: columns calculation not correct when paint lines containing chinese characters
This commit is contained in:
parent
69ba84fc86
commit
dda0f82b4d
1
NEWS.md
1
NEWS.md
|
@ -1,5 +1,6 @@
|
||||||
Version 0.9.3 For Dev-C++ 7 Beta
|
Version 0.9.3 For Dev-C++ 7 Beta
|
||||||
- fix: the count in the title of issues view isn't correct
|
- 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
|
Version 0.9.2 For Dev-C++ 7 Beta
|
||||||
- fix: gutter of the disassembly code control in the cpu info dialog is grayed
|
- fix: gutter of the disassembly code control in the cpu info dialog is grayed
|
||||||
|
|
|
@ -876,7 +876,6 @@ void Editor::onPreparePaintHighlightToken(int line, int aChar, const QString &to
|
||||||
if (token.isEmpty())
|
if (token.isEmpty())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
// qDebug()<<token<<"-"<<attr->name()<<" - "<<line<<" : "<<aChar;
|
|
||||||
if (mParser && highlighter() && (attr == highlighter()->identifierAttribute())) {
|
if (mParser && highlighter() && (attr == highlighter()->identifierAttribute())) {
|
||||||
BufferCoord p{aChar,line};
|
BufferCoord p{aChar,line};
|
||||||
BufferCoord pBeginPos,pEndPos;
|
BufferCoord pBeginPos,pEndPos;
|
||||||
|
|
|
@ -5695,16 +5695,6 @@ void MainWindow::on_actionProblem_triggered()
|
||||||
showHideMessagesTab(ui->tabProblem,state);
|
showHideMessagesTab(ui->tabProblem,state);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void MainWindow::on_actionInsert_Line_triggered()
|
|
||||||
{
|
|
||||||
Editor *e=mEditorList->getEditor();
|
|
||||||
if (e) {
|
|
||||||
e->insertLine();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void MainWindow::on_actionDelete_Line_triggered()
|
void MainWindow::on_actionDelete_Line_triggered()
|
||||||
{
|
{
|
||||||
Editor *e=mEditorList->getEditor();
|
Editor *e=mEditorList->getEditor();
|
||||||
|
@ -5713,7 +5703,6 @@ void MainWindow::on_actionDelete_Line_triggered()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void MainWindow::on_actionDuplicate_Line_triggered()
|
void MainWindow::on_actionDuplicate_Line_triggered()
|
||||||
{
|
{
|
||||||
Editor *e=mEditorList->getEditor();
|
Editor *e=mEditorList->getEditor();
|
||||||
|
|
|
@ -518,8 +518,6 @@ private slots:
|
||||||
|
|
||||||
void on_actionProblem_triggered();
|
void on_actionProblem_triggered();
|
||||||
|
|
||||||
void on_actionInsert_Line_triggered();
|
|
||||||
|
|
||||||
void on_actionDelete_Line_triggered();
|
void on_actionDelete_Line_triggered();
|
||||||
|
|
||||||
void on_actionDuplicate_Line_triggered();
|
void on_actionDuplicate_Line_triggered();
|
||||||
|
|
|
@ -250,6 +250,10 @@ void SynEdit::setCaretXYEx(bool CallEnsureCursorPos, BufferCoord value)
|
||||||
invalidateLine(mCaretY);
|
invalidateLine(mCaretY);
|
||||||
invalidateLine(oldCaretY);
|
invalidateLine(oldCaretY);
|
||||||
}
|
}
|
||||||
|
if (mGutter.activeLineTextColor().isValid()) {
|
||||||
|
invalidateGutterLine(mCaretY);
|
||||||
|
invalidateGutterLine(oldCaretY);
|
||||||
|
}
|
||||||
mStatusChanges.setFlag(SynStatusChange::scCaretY);
|
mStatusChanges.setFlag(SynStatusChange::scCaretY);
|
||||||
}
|
}
|
||||||
// Call UpdateLastCaretX before DecPaintLock because the event handler it
|
// 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 SynEdit::stringColumns(const QString &line, int colsBefore) const
|
||||||
{
|
{
|
||||||
int columns = colsBefore;
|
int columns = std::max(0,colsBefore);
|
||||||
int charCols;
|
int charCols;
|
||||||
for (int i=0;i<line.length();i++) {
|
for (int i=0;i<line.length();i++) {
|
||||||
QChar ch = line[i];
|
QChar ch = line[i];
|
||||||
|
|
|
@ -995,7 +995,7 @@ void SynEditTextPainter::PaintLines()
|
||||||
edit->mHighlighter->next();
|
edit->mHighlighter->next();
|
||||||
}
|
}
|
||||||
// Don't assume HL.GetTokenPos is valid after HL.GetEOL == True.
|
// 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)) {
|
if (edit->mHighlighter->eol() && (nTokenColumnsBefore < vLastChar)) {
|
||||||
int lineColumns = edit->mLines->lineColumns(vLine-1);
|
int lineColumns = edit->mLines->lineColumns(vLine-1);
|
||||||
// Draw text that couldn't be parsed by the highlighter, if any.
|
// Draw text that couldn't be parsed by the highlighter, if any.
|
||||||
|
|
Loading…
Reference in New Issue