| 970 | } |
| 971 | |
| 972 | void ContextBrowserPlugin::cursorPositionChanged(View* view, const KTextEditor::Cursor& newPosition) |
| 973 | { |
| 974 | const bool atInsertPosition = (view->document() == m_lastInsertionDocument && newPosition == m_lastInsertionPos); |
| 975 | if (atInsertPosition) { |
| 976 | //Do not update the highlighting while typing |
| 977 | m_lastInsertionDocument = nullptr; |
| 978 | m_lastInsertionPos = KTextEditor::Cursor(); |
| 979 | } |
| 980 | |
| 981 | const auto viewHighlightsIt = m_highlightedRanges.find(view); |
| 982 | if (viewHighlightsIt != m_highlightedRanges.end()) { |
| 983 | viewHighlightsIt->keep = atInsertPosition; |
| 984 | } |
| 985 | |
| 986 | clearMouseHover(); |
| 987 | m_updateViews.insert(view); |
| 988 | m_updateTimer->start(highlightingTimeout / 2); // triggers updateViews() |
| 989 | } |
| 990 | |
| 991 | void ContextBrowserPlugin::textInserted(KTextEditor::Document* doc, const KTextEditor::Cursor& cursor, |
| 992 | const QString& text) |