Changeset View
Changeset View
Standalone View
Standalone View
src/document/katedocument.cpp
Show First 20 Lines • Show All 91 Lines • ▼ Show 20 Line(s) | 3004 | else { | |||
---|---|---|---|---|---|
3065 | } | 3065 | } | ||
3066 | if (!closingBracket.isNull() && !skipAutobrace ) { | 3066 | if (!closingBracket.isNull() && !skipAutobrace ) { | ||
3067 | // add bracket to the view | 3067 | // add bracket to the view | ||
3068 | const auto cursorPos(view->cursorPosition()); | 3068 | const auto cursorPos(view->cursorPosition()); | ||
3069 | const auto nextChar = view->document()->text({cursorPos, cursorPos + Cursor{0, 1}}).trimmed(); | 3069 | const auto nextChar = view->document()->text({cursorPos, cursorPos + Cursor{0, 1}}).trimmed(); | ||
3070 | if ( nextChar.isEmpty() || ! nextChar.at(0).isLetterOrNumber() ) { | 3070 | if ( nextChar.isEmpty() || ! nextChar.at(0).isLetterOrNumber() ) { | ||
3071 | insertText(view->cursorPosition(), QString(closingBracket)); | 3071 | insertText(view->cursorPosition(), QString(closingBracket)); | ||
3072 | const auto insertedAt(view->cursorPosition()); | 3072 | const auto insertedAt(view->cursorPosition()); | ||
3073 | view->setCursorPosition(cursorPos); | | |||
loh.tar: Perhaps should that line not removed but out-commentend with a note why | |||||
3074 | m_currentAutobraceRange.reset(newMovingRange({cursorPos - Cursor{0, 1}, insertedAt}, | 3073 | m_currentAutobraceRange.reset(newMovingRange({cursorPos - Cursor{0, 1}, insertedAt}, | ||
3075 | KTextEditor::MovingRange::DoNotExpand)); | 3074 | KTextEditor::MovingRange::DoNotExpand)); | ||
3076 | connect(view, &View::cursorPositionChanged, | 3075 | connect(view, &View::cursorPositionChanged, | ||
3077 | this, &DocumentPrivate::checkCursorForAutobrace, Qt::UniqueConnection); | 3076 | this, &DocumentPrivate::checkCursorForAutobrace, Qt::UniqueConnection); | ||
3078 | 3077 | | |||
3079 | // add bracket to chars inserted! needed for correct signals + indent | 3078 | // add bracket to chars inserted! needed for correct signals + indent | ||
3080 | chars.append(closingBracket); | 3079 | chars.append(closingBracket); | ||
3081 | } | 3080 | } | ||
▲ Show 20 Lines • Show All 91 Lines • Show Last 20 Lines |
Perhaps should that line not removed but out-commentend with a note why