Bug 399014 - Text editor jumps when inserting a new bracket with auto-brackets.
Summary: Text editor jumps when inserting a new bracket with auto-brackets.
Status: RESOLVED FIXED
Alias: None
Product: kate
Classification: Applications
Component: general (show other bugs)
Version: 18.12.1
Platform: Ubuntu Linux
: NOR normal
Target Milestone: ---
Assignee: KWrite Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-09-24 11:51 UTC by Simon Westersund
Modified: 2019-04-13 14:20 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In: 5.58


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Simon Westersund 2018-09-24 11:51:52 UTC
SUMMARY Text editor jumps when inserting a new bracket with auto-brackets.


STEPS TO REPRODUCE
1. Enable auto-brackets and scroll past last line of the editor.
2. Put the cursor on the last line of a document.
3. Scroll the document so that the last line isn't in the middle.
4. Insert a new parenthesis or other bracket.

EXPECTED RESULT
Inserts both a start and end parenthesis and the edited line stays where it is.

ACTUAL RESULT
Inserts both a start and end parenthesis but the edited line jumps to the middle of the screen (vertical scrolling happens).
Comment 1 Simon Westersund 2018-09-24 15:51:50 UTC
This bug also reproduces on KDE Neon with:
Kate version 18.08.1
KDE Frameworks 5.50.0
Qt 5.11.1
Comment 2 Dominik Haumann 2018-12-30 09:45:17 UTC
I wonder whether this is related to https://bugs.kde.org/show_bug.cgi?id=306745 - can you investigate?
Comment 3 Dominik Haumann 2018-12-30 09:46:01 UTC
Proposed patch: https://phabricator.kde.org/D17857
Comment 4 Simon Westersund 2019-01-11 17:40:19 UTC
(In reply to Dominik Haumann from comment #2)
> I wonder whether this is related to
> https://bugs.kde.org/show_bug.cgi?id=306745 - can you investigate?

Thanks for your replies Dominik, and sorry for my late response.

I tested this today with Kate 18.12.1, and this issue still reproduces. I updated the version of the issue, to keep it up-to-date.
(Other version numbers at the moment: KDE Frameworks 5.53.0, Qt 5.11.2 (built against 5.11.2), xcb windowing system)

I also had a look at https://bugs.kde.org/show_bug.cgi?id=306745 but that issue does not reproduce for me. That is, it does not reproduce by typing anything, except auto-bracket characters.
Comment 5 Christoph Cullmann 2019-03-04 19:07:52 UTC
Git commit 65e3b5462f1c4b7f3d5934bd336d0b5e9412e49e by Christoph Cullmann, on behalf of loh tar.
Committed on 04/03/2019 at 19:09.
Pushed by cullmann into branch 'master'.

DocumentPrivate: Don't scroll view when add auto-bracket at end of file

Summary:
...when 'Allow scrolling past the end of the document' is set

Test Plan:
See https://bugs.kde.org/show_bug.cgi?id=399014

Reviewers: #ktexteditor, cullmann

Reviewed By: #ktexteditor, cullmann

Subscribers: swestersund, cullmann, dhaumann, kwrite-devel, kde-frameworks-devel, #ktexteditor

Tags: #kate, #frameworks

Differential Revision: https://phabricator.kde.org/D17857

M  +0    -1    src/document/katedocument.cpp

https://commits.kde.org/ktexteditor/65e3b5462f1c4b7f3d5934bd336d0b5e9412e49e
Comment 6 Lothar 2019-04-13 14:20:01 UTC
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 306745
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