Changeset View
Changeset View
Standalone View
Standalone View
src/document/katedocument.cpp
Show First 20 Lines • Show All 3207 Lines • ▼ Show 20 Line(s) | |||||
3208 | } | 3208 | } | ||
3209 | 3209 | | |||
3210 | void KTextEditor::DocumentPrivate::checkCursorForAutobrace(KTextEditor::View*, const KTextEditor::Cursor& newPos) { | 3210 | void KTextEditor::DocumentPrivate::checkCursorForAutobrace(KTextEditor::View*, const KTextEditor::Cursor& newPos) { | ||
3211 | if ( m_currentAutobraceRange && ! m_currentAutobraceRange->toRange().contains(newPos) ) { | 3211 | if ( m_currentAutobraceRange && ! m_currentAutobraceRange->toRange().contains(newPos) ) { | ||
3212 | m_currentAutobraceRange.clear(); | 3212 | m_currentAutobraceRange.clear(); | ||
3213 | } | 3213 | } | ||
3214 | } | 3214 | } | ||
3215 | 3215 | | |||
3216 | void KTextEditor::DocumentPrivate::newLine(KTextEditor::ViewPrivate *v) | 3216 | void KTextEditor::DocumentPrivate::newLine(KTextEditor::ViewPrivate *v, | ||
3217 | KTextEditor::DocumentPrivate::NewLineIndent indent) | ||||
3217 | { | 3218 | { | ||
3218 | editStart(); | 3219 | editStart(); | ||
3219 | 3220 | | |||
3220 | if (!v->config()->persistentSelection() && v->selection()) { | 3221 | if (!v->config()->persistentSelection() && v->selection()) { | ||
3221 | v->removeSelectedText(); | 3222 | v->removeSelectedText(); | ||
3222 | v->clearSelection(); | 3223 | v->clearSelection(); | ||
3223 | } | 3224 | } | ||
3224 | 3225 | | |||
Show All 17 Lines | |||||
3242 | } | 3243 | } | ||
3243 | 3244 | | |||
3244 | // first: wrap line | 3245 | // first: wrap line | ||
3245 | editWrapLine(c.line(), c.column()); | 3246 | editWrapLine(c.line(), c.column()); | ||
3246 | 3247 | | |||
3247 | // end edit session here, to have updated HL in userTypedChar! | 3248 | // end edit session here, to have updated HL in userTypedChar! | ||
3248 | editEnd(); | 3249 | editEnd(); | ||
3249 | 3250 | | |||
3250 | // second: indent the new line, if needed... | 3251 | // second: if "indent" is true, indent the new line, if needed... | ||
3252 | if (indent == KTextEditor::DocumentPrivate::Indent) { | ||||
3251 | m_indenter->userTypedChar(v, v->cursorPosition(), QLatin1Char('\n')); | 3253 | m_indenter->userTypedChar(v, v->cursorPosition(), QLatin1Char('\n')); | ||
3252 | } | 3254 | } | ||
3255 | } | ||||
3253 | 3256 | | |||
3254 | void KTextEditor::DocumentPrivate::transpose(const KTextEditor::Cursor &cursor) | 3257 | void KTextEditor::DocumentPrivate::transpose(const KTextEditor::Cursor &cursor) | ||
3255 | { | 3258 | { | ||
3256 | Kate::TextLine textLine = m_buffer->plainLine(cursor.line()); | 3259 | Kate::TextLine textLine = m_buffer->plainLine(cursor.line()); | ||
3257 | 3260 | | |||
3258 | if (!textLine || (textLine->length() < 2)) { | 3261 | if (!textLine || (textLine->length() < 2)) { | ||
3259 | return; | 3262 | return; | ||
3260 | } | 3263 | } | ||
▲ Show 20 Lines • Show All 2821 Lines • Show Last 20 Lines |