Commit e75bde23 authored by Dominik Haumann's avatar Dominik Haumann
Browse files

Revert Fix: View jumps when Scroll past end of document is enabled

Unfortunately, this introduced a regression that scrolling down in
dynamically wrapped lines did not move the view at all. We need
to find a better fix, and introduce a unit test.

CCBUG: 306745
BUG: 391838
FIXED-IN: 5.45
parent 5cbf9036
......@@ -293,6 +293,7 @@ void KateViewTest::testKillline()
void KateViewTest::testScrollPastEndOfDocument()
{
#if 0 // bug still exists, see bug 306745
KTextEditor::DocumentPrivate doc;
doc.setText(QStringLiteral("0000000000\n"
"1111111111\n"
......@@ -322,6 +323,7 @@ void KateViewTest::testScrollPastEndOfDocument()
QCOMPARE(view->cursorPosition(), KTextEditor::Cursor(4, 5));
// verify, that only lines 3333333333 and 4444444444 are still visible.
QCOMPARE(view->firstDisplayedLineInternal(KTextEditor::View::RealLine), 3);
#endif
}
void KateViewTest::testFoldFirstLine()
......
......@@ -709,7 +709,7 @@ void KateViewInternal::makeVisible(const KTextEditor::Cursor &c, int endCol, boo
} else if (center && (c < startPos() || c > endPos())) {
KTextEditor::Cursor scroll = viewLineOffset(c, -int(linesDisplayed()) / 2);
scrollPos(scroll, false, calledExternally);
} else if (c.line() > viewLineOffset(startPos(), linesDisplayed() - m_minLinesVisible - 1).line()) {
} else if (c > viewLineOffset(startPos(), linesDisplayed() - m_minLinesVisible - 1)) {
KTextEditor::Cursor scroll = viewLineOffset(c, -(linesDisplayed() - m_minLinesVisible - 1));
scrollPos(scroll, false, calledExternally);
} else if (c < viewLineOffset(startPos(), m_minLinesVisible)) {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment