Skip to content
Commit 2bed94b6 authored by Dominik Haumann's avatar Dominik Haumann
Browse files

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

Summary:
This patch fixes a corner case for the following setup:
- enable "[x] Scroll past end of document"
- disable dynamic word wrap (i.e. you see a horizontal
  scrollbar for long lines)
- open a document with several lines
- make sure the last line is NOT empty

Let's say the last two lines look as follows

yy|yy # '|' denoes the cursor position
zzzzz

Make sure you scrolled past the end of the document (either
with the mouse or with Ctrl+Down). Note that line 'zzzzz' is
completely visible.

Now press 'cursor down'.

What happens is that the view contents jumps and the scrolling
behavior acts as if "Scroll past end of document" is not enabled.

Expected behavior is that the cursor position goes one line down,
but the scroll position remains completely unchanged.

The bug here is the following if clause:

    } else if (c > viewLineOffset(startPos(), linesDisplayed() - m_minLinesVisible - 1)) {
        KTextEditor::Cursor scroll = viewLineOff...
parent fbdfe779
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