Changeset View
Changeset View
Standalone View
Standalone View
autotests/src/vimode/view.cpp
Show First 20 Lines • Show All 91 Lines • ▼ Show 20 Line(s) | 99 | { | |||
---|---|---|---|---|---|
106 | kate_view->renderer()->config()->setFont(fixedWidthFont); | 106 | kate_view->renderer()->config()->setFont(fixedWidthFont); | ||
107 | const bool oldDynWordWrap = KateViewConfig::global()->dynWordWrap(); | 107 | const bool oldDynWordWrap = KateViewConfig::global()->dynWordWrap(); | ||
108 | KateViewConfig::global()->setDynWordWrap(true); | 108 | KateViewConfig::global()->setDynWordWrap(true); | ||
109 | const bool oldReplaceTabsDyn = kate_document->config()->replaceTabsDyn(); | 109 | const bool oldReplaceTabsDyn = kate_document->config()->replaceTabsDyn(); | ||
110 | kate_document->config()->setReplaceTabsDyn(false); | 110 | kate_document->config()->setReplaceTabsDyn(false); | ||
111 | const int oldTabWidth = kate_document->config()->tabWidth(); | 111 | const int oldTabWidth = kate_document->config()->tabWidth(); | ||
112 | const int tabWidth = 5; | 112 | const int tabWidth = 5; | ||
113 | kate_document->config()->setTabWidth(tabWidth); | 113 | kate_document->config()->setTabWidth(tabWidth); | ||
114 | KateViewConfig::global()->setShowScrollbars(0); | 114 | KateViewConfig::global()->setValue(KateViewConfig::ShowScrollbars, KateViewConfig::ScrollbarMode::AlwaysOn); | ||
115 | 115 | | |||
116 | // Compute the maximum width of text before line-wrapping sets it. | 116 | // Compute the maximum width of text before line-wrapping sets it. | ||
117 | int textWrappingLength = 1; | 117 | int textWrappingLength = 1; | ||
118 | while (true) { | 118 | while (true) { | ||
119 | QString text = QString("X").repeated(textWrappingLength) + ' ' + 'O'; | 119 | QString text = QString("X").repeated(textWrappingLength) + ' ' + 'O'; | ||
120 | const int posOfO = text.length() - 1; | 120 | const int posOfO = text.length() - 1; | ||
121 | kate_document->setText(text); | 121 | kate_document->setText(text); | ||
122 | if (kate_view->cursorToCoordinate(Cursor(0, posOfO)).y() != kate_view->cursorToCoordinate(Cursor(0, 0)).y()) { | 122 | if (kate_view->cursorToCoordinate(Cursor(0, posOfO)).y() != kate_view->cursorToCoordinate(Cursor(0, 0)).y()) { | ||
▲ Show 20 Lines • Show All 91 Lines • Show Last 20 Lines |