Fix navigation history issues.

Separating navigation history logic from updating of highlights.
This commit is contained in:
con
2010-02-08 16:54:14 +01:00
parent f133d0ac8c
commit 7391ba388c
2 changed files with 8 additions and 3 deletions

View File

@@ -223,7 +223,7 @@ BaseTextEditor::BaseTextEditor(QWidget *parent)
d->m_searchResultFormat.setBackground(QColor(0xffef0b));
slotUpdateExtraAreaWidth();
slotCursorPositionChanged();
updateHighlights();
setFrameStyle(QFrame::NoFrame);
d->m_delayedUpdateTimer = new QTimer(this);
@@ -3198,7 +3198,11 @@ void BaseTextEditor::slotCursorPositionChanged()
} else if (d->m_contentsChanged) {
saveCurrentCursorPositionForNavigation();
}
updateHighlights();
}
void BaseTextEditor::updateHighlights()
{
if (d->m_parenthesesMatchingEnabled && hasFocus()) {
// Delay update when no matching is displayed yet, to avoid flicker
if (extraSelections(ParenthesesMatchingSelection).isEmpty()
@@ -4774,7 +4778,7 @@ void BaseTextEditor::changeEvent(QEvent *e)
void BaseTextEditor::focusInEvent(QFocusEvent *e)
{
QPlainTextEdit::focusInEvent(e);
slotCursorPositionChanged();
updateHighlights();
}
void BaseTextEditor::focusOutEvent(QFocusEvent *e)
@@ -5157,7 +5161,7 @@ void BaseTextEditor::setDisplaySettings(const DisplaySettings &ds)
d->m_highlightBlocksInfo = BaseTextEditorPrivateHighlightBlocks();
}
slotCursorPositionChanged();
updateHighlights();
viewport()->update();
extraArea()->update();
}