Bug 408418

Summary: New "go to line" behaviour is less useful than before
Product: [Applications] kate Reporter: Albert Astals Cid <aacid>
Component: generalAssignee: KWrite Developers <kwrite-bugs-null>
Severity: normal CC: a.samirh78, cullmann, loh.tar, nate
Priority: HI Keywords: usability
Version: 19.04.2   
Target Milestone: ---   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed In: 5.61

Description Albert Astals Cid 2019-06-07 15:04:28 UTC
400 line document
be at first line
Press Ctrl+G and go to line 100

Old behaviour: Line 100 is in the middle of the view
New behaviour: Line 100 is at the bottom of the view

Old behaviour is much more useful because when i am interested in a line i'm usually interested in its surroundings, and that includes line 101 that is now not visible while before it was.
Comment 1 Lothar 2019-06-08 06:47:37 UTC
I notice also such less optimal behavior and guess it's caused by this one:
https://phabricator.kde.org/D17857#425268 (now it's line 1493, not 63)

But just to revert this isn't a proper fix. Perhaps should there some special function for such "goto" action with a better centering to the screen. I guess it's not only an issue of these explicit "Goto Line" action but also when jump to e.g. next search result.
Comment 2 Ahmad Samir 2019-06-19 18:13:10 UTC
IMHO, the change in updateCursor(), should be reverted; and if there's a use case where that behaviour isn't wanted, then we can make setCursorPosition() and setCursorPositionInternal() have an extra boolean parameter - that's true by default - to center the cursor line in the view; that means any caller that doesn't want that bevhaviour can easily opt-out, a case by case treatment...
Comment 3 Ahmad Samir 2019-07-07 11:53:33 UTC
Comment 4 Christoph Cullmann 2019-07-07 11:59:18 UTC
I guess, as nobody seems to have time, perhaps partial revert is a good idea.
Which commit was it exactly?
Comment 5 Christoph Cullmann 2019-07-07 12:05:25 UTC
Git commit 49b8add426a252afc1976188baebde194d75ced2 by Christoph Cullmann.
Committed on 07/07/2019 at 12:04.
Pushed by cullmann into branch 'master'.

fix goto line centering
force center for any external set cursor position call

M  +1    -1    src/view/kateview.cpp

Comment 6 Albert Astals Cid 2019-08-01 13:50:22 UTC
Hmm, you only decided to forcecenter for external calls.

But this is about Ctrl+G

This is not an external call, is it?
Comment 7 Christoph Cullmann 2019-08-24 15:08:29 UTC
;=) As confusing this is, the call for CTRL-G is "external", too.
For me it properly centerse again for that action, too.