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
| 53 | // range. Selection is set only for non-empty ranges |
| 54 | // Factored into a function since its needed in 3 places already |
| 55 | static 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 | |
| 63 | class TextDocumentPrivate |
| 64 | { |
no test coverage detected