Changeset View
Changeset View
Standalone View
Standalone View
src/view/kateviewinternal.cpp
Show First 20 Lines • Show All 91 Lines • ▼ Show 20 Line(s) | 862 | if (!m_bm->toRange().isValid()) { | |||
---|---|---|---|---|---|
863 | return KTextEditor::Cursor::invalid(); | 863 | return KTextEditor::Cursor::invalid(); | ||
864 | } | 864 | } | ||
865 | 865 | | |||
866 | Q_ASSERT(m_bmEnd->toRange().isValid()); | 866 | Q_ASSERT(m_bmEnd->toRange().isValid()); | ||
867 | Q_ASSERT(m_bmStart->toRange().isValid()); | 867 | Q_ASSERT(m_bmStart->toRange().isValid()); | ||
868 | 868 | | |||
869 | if (m_bmStart->toRange().contains(m_cursor) || m_bmStart->end() == m_cursor.toCursor()) { | 869 | if (m_bmStart->toRange().contains(m_cursor) || m_bmStart->end() == m_cursor.toCursor()) { | ||
870 | c = m_bmEnd->end(); | 870 | c = m_bmEnd->end(); | ||
871 | // We need to adjust the cursor positon in case of override mode, BUG-402594 | ||||
872 | if (doc()->config()->ovr()) { | ||||
873 | c.setColumn(c.column() - 1); | ||||
874 | } | ||||
871 | } else if (m_bmEnd->toRange().contains(m_cursor) || m_bmEnd->end() == m_cursor.toCursor()) { | 875 | } else if (m_bmEnd->toRange().contains(m_cursor) || m_bmEnd->end() == m_cursor.toCursor()) { | ||
872 | c = m_bmStart->start(); | 876 | c = m_bmStart->start(); | ||
873 | } else { | 877 | } else { | ||
874 | // should never happen: a range exists, but the cursor position is | 878 | // should never happen: a range exists, but the cursor position is | ||
875 | // neither at the start nor at the end... | 879 | // neither at the start nor at the end... | ||
876 | return KTextEditor::Cursor::invalid(); | 880 | return KTextEditor::Cursor::invalid(); | ||
877 | } | 881 | } | ||
878 | 882 | | |||
▲ Show 20 Lines • Show All 91 Lines • Show Last 20 Lines |