Lines Matching refs:m_view

87     m_view = static_cast<KTextEditor::ViewPrivate *>(v);  in init()
88 Q_ASSERT(m_view); in init()
91 m_view->show(); in init()
96 delete m_view; in cleanup()
102 KateCompletionModel *model = m_view->completionWidget()->model(); in testFilterEmptyRange()
104 new CodeCompletionTestModel(m_view, QStringLiteral("a")); in testFilterEmptyRange()
105 m_view->setCursorPosition(Cursor(0, 0)); in testFilterEmptyRange()
106 invokeCompletionBox(m_view); in testFilterEmptyRange()
109 m_view->insertText(QStringLiteral("aa")); in testFilterEmptyRange()
116 KateCompletionModel *model = m_view->completionWidget()->model(); in testFilterWithRange()
118 CodeCompletionTestModel *testModel = new CodeCompletionTestModel(m_view, QStringLiteral("a")); in testFilterWithRange()
119 m_view->setCursorPosition(Cursor(0, 2)); in testFilterWithRange()
120 invokeCompletionBox(m_view); in testFilterWithRange()
122 Range complRange = *m_view->completionWidget()->completionRange(testModel); in testFilterWithRange()
126 m_view->insertText(QStringLiteral("a")); in testFilterWithRange()
133 KateCompletionModel *model = m_view->completionWidget()->model(); in testAbortCursorMovedOutOfRange()
135 new CodeCompletionTestModel(m_view, QStringLiteral("a")); in testAbortCursorMovedOutOfRange()
136 m_view->setCursorPosition(Cursor(0, 2)); in testAbortCursorMovedOutOfRange()
137 invokeCompletionBox(m_view); in testAbortCursorMovedOutOfRange()
140 QVERIFY(m_view->completionWidget()->isCompletionActive()); in testAbortCursorMovedOutOfRange()
142 m_view->setCursorPosition(Cursor(0, 4)); in testAbortCursorMovedOutOfRange()
144 QVERIFY(!m_view->completionWidget()->isCompletionActive()); in testAbortCursorMovedOutOfRange()
149 KateCompletionModel *model = m_view->completionWidget()->model(); in testAbortInvalidText()
151 new CodeCompletionTestModel(m_view, QStringLiteral("a")); in testAbortInvalidText()
152 m_view->setCursorPosition(Cursor(0, 2)); in testAbortInvalidText()
153 invokeCompletionBox(m_view); in testAbortInvalidText()
156 QVERIFY(m_view->completionWidget()->isCompletionActive()); in testAbortInvalidText()
158 m_view->insertText(QStringLiteral(".")); in testAbortInvalidText()
159 verifyCompletionAborted(m_view); in testAbortInvalidText()
165 KateCompletionModel *model = m_view->completionWidget()->model(); in testCustomRange1()
167 CodeCompletionTestModel *testModel = new CustomRangeModel(m_view, QStringLiteral("$a")); in testCustomRange1()
168 m_view->setCursorPosition(Cursor(0, 3)); in testCustomRange1()
169 invokeCompletionBox(m_view); in testCustomRange1()
171 Range complRange = *m_view->completionWidget()->completionRange(testModel); in testCustomRange1()
176 m_view->insertText(QStringLiteral("a")); in testCustomRange1()
184 KateCompletionModel *model = m_view->completionWidget()->model(); in testCustomRange2()
186 CodeCompletionTestModel *testModel = new CustomRangeModel(m_view, QStringLiteral("$a")); in testCustomRange2()
187 m_view->setCursorPosition(Cursor(0, 1)); in testCustomRange2()
188 invokeCompletionBox(m_view); in testCustomRange2()
190 Range complRange = *m_view->completionWidget()->completionRange(testModel); in testCustomRange2()
194 m_view->insertText(QStringLiteral("aa")); in testCustomRange2()
202 KateCompletionModel *model = m_view->completionWidget()->model(); in testCustomRangeMultipleModels()
204 CodeCompletionTestModel *testModel1 = new CustomRangeModel(m_view, QStringLiteral("$a")); in testCustomRangeMultipleModels()
205 CodeCompletionTestModel *testModel2 = new CodeCompletionTestModel(m_view, QStringLiteral("a")); in testCustomRangeMultipleModels()
206 m_view->setCursorPosition(Cursor(0, 1)); in testCustomRangeMultipleModels()
207 invokeCompletionBox(m_view); in testCustomRangeMultipleModels()
209 …QCOMPARE(Range(*m_view->completionWidget()->completionRange(testModel1)), Range(Cursor(0, 0), Curs… in testCustomRangeMultipleModels()
210 …QCOMPARE(Range(*m_view->completionWidget()->completionRange(testModel2)), Range(Cursor(0, 1), Curs… in testCustomRangeMultipleModels()
215 m_view->insertText(QStringLiteral("aa")); in testCustomRangeMultipleModels()
224 KateCompletionModel *model = m_view->completionWidget()->model(); in testAbortController()
226 new CustomRangeModel(m_view, QStringLiteral("$a")); in testAbortController()
227 m_view->setCursorPosition(Cursor(0, 0)); in testAbortController()
228 invokeCompletionBox(m_view); in testAbortController()
231 QVERIFY(m_view->completionWidget()->isCompletionActive()); in testAbortController()
233 m_view->insertText(QStringLiteral("$a")); in testAbortController()
235 QVERIFY(m_view->completionWidget()->isCompletionActive()); in testAbortController()
237 m_view->insertText(QStringLiteral(".")); in testAbortController()
238 verifyCompletionAborted(m_view); in testAbortController()
243 KateCompletionModel *model = m_view->completionWidget()->model(); in testAbortControllerMultipleModels()
245 CodeCompletionTestModel *testModel1 = new CodeCompletionTestModel(m_view, QStringLiteral("aa")); in testAbortControllerMultipleModels()
246 CodeCompletionTestModel *testModel2 = new CustomAbortModel(m_view, QStringLiteral("a-")); in testAbortControllerMultipleModels()
247 m_view->setCursorPosition(Cursor(0, 0)); in testAbortControllerMultipleModels()
248 invokeCompletionBox(m_view); in testAbortControllerMultipleModels()
251 QVERIFY(m_view->completionWidget()->isCompletionActive()); in testAbortControllerMultipleModels()
253 m_view->insertText(QStringLiteral("a")); in testAbortControllerMultipleModels()
255 QVERIFY(m_view->completionWidget()->isCompletionActive()); in testAbortControllerMultipleModels()
258 m_view->insertText(QStringLiteral("-")); in testAbortControllerMultipleModels()
260 QVERIFY(m_view->completionWidget()->isCompletionActive()); in testAbortControllerMultipleModels()
261 QVERIFY(!m_view->completionWidget()->completionRanges().contains(testModel1)); in testAbortControllerMultipleModels()
262 QVERIFY(m_view->completionWidget()->completionRanges().contains(testModel2)); in testAbortControllerMultipleModels()
266 m_view->insertText(QLatin1String(" ")); in testAbortControllerMultipleModels()
268 QVERIFY(!m_view->completionWidget()->isCompletionActive()); in testAbortControllerMultipleModels()
273 KateCompletionModel *model = m_view->completionWidget()->model(); in testEmptyFilterString()
275 new EmptyFilterStringModel(m_view, QStringLiteral("aa")); in testEmptyFilterString()
276 m_view->setCursorPosition(Cursor(0, 0)); in testEmptyFilterString()
277 invokeCompletionBox(m_view); in testEmptyFilterString()
281 m_view->insertText(QStringLiteral("a")); in testEmptyFilterString()
285 m_view->insertText(QStringLiteral("bam")); in testEmptyFilterString()
293 KateCompletionModel *model = m_view->completionWidget()->model(); in testUpdateCompletionRange()
295 …CodeCompletionTestModel *testModel = new UpdateCompletionRangeModel(m_view, QStringLiteral("ab ab"… in testUpdateCompletionRange()
296 m_view->setCursorPosition(Cursor(0, 3)); in testUpdateCompletionRange()
297 invokeCompletionBox(m_view); in testUpdateCompletionRange()
300 …QCOMPARE(Range(*m_view->completionWidget()->completionRange(testModel)), Range(Cursor(0, 3), Curso… in testUpdateCompletionRange()
302 m_view->insertText(QStringLiteral("ab")); in testUpdateCompletionRange()
304 …QCOMPARE(Range(*m_view->completionWidget()->completionRange(testModel)), Range(Cursor(0, 0), Curso… in testUpdateCompletionRange()
310 KateCompletionModel *model = m_view->completionWidget()->model(); in testCustomStartCompl()
312 m_view->completionWidget()->setAutomaticInvocationDelay(1); in testCustomStartCompl()
314 new StartCompletionModel(m_view, QStringLiteral("aa")); in testCustomStartCompl()
316 m_view->setCursorPosition(Cursor(0, 0)); in testCustomStartCompl()
317 m_view->insertText("%"); in testCustomStartCompl()
320 QVERIFY(m_view->completionWidget()->isCompletionActive()); in testCustomStartCompl()
326 KateCompletionModel *model = m_view->completionWidget()->model(); in testKateCompletionModel()
327 CodeCompletionTestModel *testModel1 = new CodeCompletionTestModel(m_view, QStringLiteral("aa")); in testKateCompletionModel()
328 CodeCompletionTestModel *testModel2 = new CodeCompletionTestModel(m_view, QStringLiteral("bb")); in testKateCompletionModel()
342 new ImmideatelyAbortCompletionModel(m_view); in testAbortImmideatelyAfterStart()
343 m_view->setCursorPosition(Cursor(0, 3)); in testAbortImmideatelyAfterStart()
344 QVERIFY(!m_view->completionWidget()->isCompletionActive()); in testAbortImmideatelyAfterStart()
345 Q_EMIT m_view->userInvokedCompletion(); in testAbortImmideatelyAfterStart()
346 QVERIFY(!m_view->completionWidget()->isCompletionActive()); in testAbortImmideatelyAfterStart()
351 new CodeCompletionTestModel(m_view, QStringLiteral("aa")); in testJumpToListBottomAfterCursorUpWhileAtTop()
352 invokeCompletionBox(m_view); in testJumpToListBottomAfterCursorUpWhileAtTop()
354 m_view->completionWidget()->cursorUp(); in testJumpToListBottomAfterCursorUpWhileAtTop()
355 m_view->completionWidget()->bottom(); in testJumpToListBottomAfterCursorUpWhileAtTop()
357 QCOMPARE(m_view->completionWidget()->treeView()->selectionModel()->currentIndex().row(), 39); in testJumpToListBottomAfterCursorUpWhileAtTop()
403 new CodeCompletionTestModel(m_view, QStringLiteral("a")); in testAutoCompletionPreselectFirst()
405 m_view->config()->setValue(KateViewConfig::AutomaticCompletionPreselectFirst, false); in testAutoCompletionPreselectFirst()
409 m_view->setCursorPosition(Cursor(0, 1)); in testAutoCompletionPreselectFirst()
410 m_view->completionWidget()->automaticInvocation(); in testAutoCompletionPreselectFirst()
411 verifyCompletionStarted(m_view); in testAutoCompletionPreselectFirst()
413 QApplication::sendEvent(m_view->focusProxy(), &enterKeyEvent); in testAutoCompletionPreselectFirst()
415 verifyCompletionAborted(m_view); in testAutoCompletionPreselectFirst()
420 m_view->completionWidget()->automaticInvocation(); in testAutoCompletionPreselectFirst()
421 m_view->completionWidget()->tab(false); in testAutoCompletionPreselectFirst()
422 m_view->completionWidget()->execute(); in testAutoCompletionPreselectFirst()
424 QVERIFY(!m_view->completionWidget()->isCompletionActive()); in testAutoCompletionPreselectFirst()
428 m_view->config()->setValue(KateViewConfig::AutomaticCompletionPreselectFirst, true); in testAutoCompletionPreselectFirst()
430 m_view->completionWidget()->automaticInvocation(); in testAutoCompletionPreselectFirst()
432 m_view->completionWidget()->tab(false); // tab should "auto-fill" completion in testAutoCompletionPreselectFirst()
434 m_view->completionWidget()->execute(); in testAutoCompletionPreselectFirst()
436 QVERIFY(!m_view->completionWidget()->isCompletionActive()); in testAutoCompletionPreselectFirst()
472 KateCompletionModel *model = m_view->completionWidget()->model(); in testAbbrevAndContainsMatching()
474 new AbbreviationCodeCompletionTestModel(m_view, QString()); in testAbbrevAndContainsMatching()
476 m_view->document()->setText(QStringLiteral("SCA")); in testAbbrevAndContainsMatching()
477 invokeCompletionBox(m_view); in testAbbrevAndContainsMatching()
480 m_view->document()->setText(QStringLiteral("SC")); in testAbbrevAndContainsMatching()
481 invokeCompletionBox(m_view); in testAbbrevAndContainsMatching()
484 m_view->document()->setText(QStringLiteral("sca")); in testAbbrevAndContainsMatching()
485 invokeCompletionBox(m_view); in testAbbrevAndContainsMatching()
488 m_view->document()->setText(QStringLiteral("contains")); in testAbbrevAndContainsMatching()
489 invokeCompletionBox(m_view); in testAbbrevAndContainsMatching()
492 m_view->document()->setText(QStringLiteral("CONTAINS")); in testAbbrevAndContainsMatching()
493 invokeCompletionBox(m_view); in testAbbrevAndContainsMatching()
496 m_view->document()->setText(QStringLiteral("containssome")); in testAbbrevAndContainsMatching()
497 invokeCompletionBox(m_view); in testAbbrevAndContainsMatching()
500 m_view->document()->setText(QStringLiteral("matched")); in testAbbrevAndContainsMatching()
501 m_view->userInvokedCompletion(); in testAbbrevAndContainsMatching()
510 …CodeCompletionTestModel *testModel1 = new CodeCompletionTestModel(m_view, QStringLiteral("abcdefg"… in benchCompletionModel()
512 …CodeCompletionTestModel *testModel2 = new CodeCompletionTestModel(m_view, QStringLiteral("abcdef")… in benchCompletionModel()
514 …CodeCompletionTestModel *testModel3 = new CodeCompletionTestModel(m_view, QStringLiteral("abcde")); in benchCompletionModel()
516 … CodeCompletionTestModel *testModel4 = new CodeCompletionTestModel(m_view, QStringLiteral("abcd")); in benchCompletionModel()
520 m_view->setCursorPosition(Cursor(0, i)); in benchCompletionModel()
521 invokeCompletionBox(m_view); in benchCompletionModel()