Bug 322532

Summary: view jumps in last line, when scroll past end of file enabled
Product: [Frameworks and Libraries] frameworks-ktexteditor Reporter: Dominik Haumann <dhaumann>
Component: generalAssignee: KWrite Developers <kwrite-bugs-null>
Status: RESOLVED FIXED    
Severity: normal CC: arichardson.kde, christoph, loh.tar
Priority: NOR    
Version First Reported In: unspecified   
Target Milestone: ---   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:

Description Dominik Haumann 2013-07-18 15:17:23 UTC
Enable in the config dialog in Editing > Text Navigation: [x] Allow scrolling past the end of the document. Further, disable dynamic word wrap.

Scroll past the end of the document. As soon as you navigate in the last line, the view jumps by scrolling up.

Research on this: The trace is:
KateViewInternal::updateCursor > makeVisible() > viewLineOffset() in:
  else if ( c > viewLineOffset(startPos(), linesDisplayed() - m_minLinesVisible - 1) )

Say you have 5 lines, i.e. 0...4, and c is in (4, 5), the viewLineOffset always returns (4, 0) when dynamic word wrap is disabled. This basically is the error that needs to be fixed.
Comment 1 Dominik Haumann 2014-09-10 21:10:57 UTC
*** Bug 315542 has been marked as a duplicate of this bug. ***
Comment 2 Lothar 2019-03-08 18:47:54 UTC
Try https://phabricator.kde.org/D17857
Comment 3 Christoph Cullmann 2019-08-24 17:10:51 UTC
Works for me, even after the last changes to fix goto line in https://phabricator.kde.org/D17857