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

Function selectAndReveal

kdevplatform/shell/textdocument.cpp:55–61  ·  view source on GitHub ↗

This sets cursor position and selection on the view to the given range. Selection is set only for non-empty ranges Factored into a function since its needed in 3 places already

Source from the content-addressed store, hash-verified

53// range. Selection is set only for non-empty ranges
54// Factored into a function since its needed in 3 places already
55static void selectAndReveal( KTextEditor::View* view, const KTextEditor::Range& range ) {
56 Q_ASSERT(view);
57 if (range.isValid()) {
58 view->setCursorPosition(range.start());
59 view->setSelection(range);
60 }
61}
62
63class TextDocumentPrivate
64{

Callers 3

setCursorPositionMethod · 0.85
setTextSelectionMethod · 0.85
setInitialRangeMethod · 0.85

Calls 4

isValidMethod · 0.45
setCursorPositionMethod · 0.45
startMethod · 0.45
setSelectionMethod · 0.45

Tested by

no test coverage detected