forked from qt-creator/qt-creator
Get rid of QChar::LineSeparator
It was causing troubles while scrolling. Replace it with \n and hack selection. Simplify the code. Now every line is a separate block. Prepare for expanding skipped lines. Change-Id: I8d305681c575abdaaf9cdbf26de864dd3a906d3a Reviewed-by: David Schulz <david.schulz@digia.com> Reviewed-by: hjk <hjk121@nokiamail.com>
This commit is contained in:
@@ -3293,8 +3293,10 @@ void BaseTextEditorWidget::paintEvent(QPaintEvent *e)
|
||||
if ((hasMainSelection && i == context.selections.size()-1)
|
||||
|| (o.format.foreground().style() == Qt::NoBrush
|
||||
&& o.format.underlineStyle() != QTextCharFormat::NoUnderline
|
||||
&& o.format.background() == Qt::NoBrush))
|
||||
prioritySelections.append(o);
|
||||
&& o.format.background() == Qt::NoBrush)) {
|
||||
if (selectionVisible(block.blockNumber()))
|
||||
prioritySelections.append(o);
|
||||
}
|
||||
else
|
||||
selections.append(o);
|
||||
}
|
||||
@@ -3484,7 +3486,6 @@ void BaseTextEditorWidget::paintEvent(QPaintEvent *e)
|
||||
int selectionStart = cursor.selectionStart();
|
||||
int selectionEnd = cursor.selectionEnd();
|
||||
|
||||
|
||||
while (block.isValid() && top <= e->rect().bottom()) {
|
||||
QTextBlock nextBlock = block.next();
|
||||
QTextBlock nextVisibleBlock = nextBlock;
|
||||
@@ -6196,6 +6197,11 @@ int BaseTextEditorWidget::lineNumberDigits() const
|
||||
return digits;
|
||||
}
|
||||
|
||||
bool BaseTextEditorWidget::selectionVisible(int blockNumber) const
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
void BaseTextEditorWidget::appendMenuActionsFromContext(QMenu *menu, const Core::Id menuContextId)
|
||||
{
|
||||
Core::ActionContainer *mcontext = Core::ActionManager::actionContainer(menuContextId);
|
||||
|
||||
Reference in New Issue
Block a user