Even though the allow scrolling past the end of the file option is activated, and even though it allows me to view past the end of the file, this feature is basically useless if you are not allowed to type without the end of the file going back to the bottom of the screen. Reproducible: Always Steps to Reproduce: 1. Turn on the scrolling past the end of the document option. 2. Scroll past the end of the document. 3. Type. Actual Results: The end of the file was placed at the end of the screen when I resumed typing. Expected Results: The end of the file should have stayed where it was and allowed me to view past the end of the file while I wrote more code.
Which KDE version are you using? This should be fixed in KDE >= 4.9.
Whichever version that is associated with Kubuntu 12.04. I'm sorry that I can't give more information than that as I uninstalled the Kubuntu desktop from Ubuntu so I do not have anything KDE related anymore.
I confirm that this bug is still present. KDE version 4.14.2. KATE version 3.14.2. Very annoying bug.
It's still an issue in KF 5.27 when you type in the very last line.
By the way, as far as I understand, this is only about the very last line, correct?
Git commit 2bed94b6d463fafbbcb38f68bef90bcf18124cc6 by Dominik Haumann. Committed on 24/01/2018 at 17:53. Pushed by dhaumann into branch 'master'. 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 = viewLineOffset(c, -(linesDisplayed() - m_minLinesVisible - 1)); scrollPos(scroll, false, calledExternally); } In the buggy case, c==(28, 1), and viewLineOffset()==(28,0). This triggers the bug that in the last line of the document for columns > 0 the scroll position is adapted. The proposed fix here is to not compare cursor positions, but only the lines. Clearly, 28 < 28 is not true, leading to no change in the scroll position. FIXED-IN: KDE Frameworks 5.43 Test Plan: make test Reviewers: cullmann Reviewed By: cullmann Subscribers: #frameworks Tags: #kate, #frameworks Differential Revision: https://phabricator.kde.org/D10054 M +33 -0 autotests/src/kateview_test.cpp M +1 -0 autotests/src/kateview_test.h M +1 -1 src/view/kateviewinternal.cpp https://commits.kde.org/ktexteditor/2bed94b6d463fafbbcb38f68bef90bcf18124cc6
Git commit e75bde233b9fe6b1a7d24cc63fa9baf9e89de895 by Dominik Haumann. Committed on 20/03/2018 at 18:51. Pushed by dhaumann into branch 'master'. 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. Related: bug 391838 FIXED-IN: 5.45 M +2 -0 autotests/src/kateview_test.cpp M +1 -1 src/view/kateviewinternal.cpp https://commits.kde.org/ktexteditor/e75bde233b9fe6b1a7d24cc63fa9baf9e89de895
Unfortunately, this change introduced a regression, therefore reopening.
Git commit cfb0af25bdfac0d8f86b42db0b34a6bc9f9a361e by loh tar. Committed on 13/04/2019 at 14:19. Pushed by lohtar into branch 'master'. ViewInternal: Fix makeVisible(..) Summary: - Proper calculation of new position to scroll - Don't force to center cursor in view in most cases. This change looks slightly dangerous but nobody knows why that was done. So we give it a try now! Related: bug 399014 FIXED-IN: 5.58 Differential Revision: https://phabricator.kde.org/D17857 M +1 -2 autotests/src/kateview_test.cpp M +1 -1 src/view/kateview.cpp M +6 -3 src/view/kateviewinternal.cpp https://commits.kde.org/ktexteditor/cfb0af25bdfac0d8f86b42db0b34a6bc9f9a361e