MCPcopy Create free account
hub / github.com/KDE/kdevelop / cursorPositionChanged

Method cursorPositionChanged

plugins/contextbrowser/contextbrowser.cpp:972–989  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

970}
971
972void 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
991void ContextBrowserPlugin::textInserted(KTextEditor::Document* doc, const KTextEditor::Cursor& cursor,
992 const QString& text)

Callers

nothing calls this directly

Calls 6

CursorClass · 0.50
documentMethod · 0.45
findMethod · 0.45
endMethod · 0.45
insertMethod · 0.45
startMethod · 0.45

Tested by

no test coverage detected