forked from qt-creator/qt-creator
Merge remote-tracking branch 'origin/4.4'
Change-Id: I02e54f45d233b89ddaee9c87da9b9af2a56374b8
This commit is contained in:
@@ -2247,9 +2247,7 @@ void TextEditorWidget::keyPressEvent(QKeyEvent *e)
|
||||
const TypingSettings &tps = d->m_document->typingSettings();
|
||||
cursor.beginEditBlock();
|
||||
|
||||
int extraBlocks =
|
||||
d->m_autoCompleter->paragraphSeparatorAboutToBeInserted(cursor,
|
||||
d->m_document->tabSettings());
|
||||
int extraBlocks = d->m_autoCompleter->paragraphSeparatorAboutToBeInserted(cursor);
|
||||
|
||||
QString previousIndentationString;
|
||||
if (tps.m_autoIndent) {
|
||||
@@ -3160,7 +3158,10 @@ void TextEditorWidgetPrivate::setupDocumentSignals()
|
||||
this, &TextEditorWidgetPrivate::documentReloadFinished);
|
||||
|
||||
QObject::connect(m_document.data(), &TextDocument::tabSettingsChanged,
|
||||
this, &TextEditorWidgetPrivate::updateTabStops);
|
||||
this, [this](){
|
||||
updateTabStops();
|
||||
m_autoCompleter->setTabSettings(m_document->tabSettings());
|
||||
});
|
||||
|
||||
QObject::connect(m_document.data(), &TextDocument::fontSettingsChanged,
|
||||
this, &TextEditorWidgetPrivate::applyFontSettingsDelayed);
|
||||
@@ -7431,7 +7432,10 @@ void TextEditorWidget::keepAutoCompletionHighlight(bool keepHighlight)
|
||||
void TextEditorWidget::setAutoCompleteSkipPosition(const QTextCursor &cursor)
|
||||
{
|
||||
QTextCursor tc = cursor;
|
||||
tc.movePosition(QTextCursor::NextCharacter, QTextCursor::KeepAnchor);
|
||||
// Create a selection of the next character but keep the current position, otherwise
|
||||
// the cursor would be removed from the list of automatically inserted text positions
|
||||
tc.movePosition(QTextCursor::NextCharacter);
|
||||
tc.movePosition(QTextCursor::PreviousCharacter, QTextCursor::KeepAnchor);
|
||||
d->autocompleterHighlight(tc);
|
||||
}
|
||||
|
||||
@@ -8239,6 +8243,7 @@ BaseTextEditor *TextEditorFactoryPrivate::createEditorHelper(const TextDocumentP
|
||||
widget->setAutoCompleter(m_autoCompleterCreator());
|
||||
|
||||
widget->setTextDocument(document);
|
||||
widget->autoCompleter()->setTabSettings(document->tabSettings());
|
||||
widget->d->m_hoverHandlers = m_hoverHandlers;
|
||||
|
||||
widget->d->m_codeAssistant.configure(widget);
|
||||
|
||||
Reference in New Issue
Block a user