Bug 66135 - Newly opened files and re-formatted files open with cursor at bottom of page. Should be centered, or in same position as before reformat.
Summary: Newly opened files and re-formatted files open with cursor at bottom of page....
Status: RESOLVED FIXED
Alias: None
Product: kdevplatform
Classification: Developer tools
Component: editor integration (show other bugs)
Version: unspecified
Platform: Gentoo Packages Linux
: NOR wishlist
Target Milestone: ---
Assignee: KDevelop Developers
URL:
Keywords:
: 66644 (view as bug list)
Depends on:
Blocks:
 
Reported: 2003-10-16 23:09 UTC by Robert Shideleff
Modified: 2008-08-23 22:54 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Robert Shideleff 2003-10-16 23:09:18 UTC
Version:           3.0.0a7 (using KDE 3.1.4)
Installed from:    Gentoo
Compiler:          gcc version 3.2.3 20030422 (Gentoo Linux 1.4 3.2.3-r1, propolice)
OS:          Linux (i686) release 2.6.0-test7-bk3

There is a very nice feature where a newly opened file will have the cursor placed at the last location prior to it being closed. Similarly, the 'Reformat Source' option also brings you back to the place you were editing.

However, in both of these cases (probably using the same code) the file opens up with the file scrolled so that the cursor is on the very bottom line of the screen. In my humble opinion, this seems like the worst behavior you could have for this feature. It would be better if the document was scrolled so that the cursor was centered.

It would be even better if in the reformatting case, the cursor would appear more or less at the same place it was before the reformat took place. (Newly opened files would simply be centered.) If this is to difficult, simply centering it would be a better approximation then the dead bottom of the screen.
Comment 1 Hendrik Kueck 2003-10-16 23:42:46 UTC
I totally agree. I use the reformatting quite a bit and having to search for the line you were just editing is annoying. 
Also, for the katepart search feature(s) I think it would be much nicer if the view would scroll so that the found line is displayed in the center instead of just scrolling by the minimum amount (which I think is what is happening currently).
Comment 2 Jens Dagerbo 2003-10-17 00:08:36 UTC
/me points to http://bugs.kde.org/show_bug.cgi?id=56067

Sadly, it didn't amount to much. :(
Comment 3 Robert Shideleff 2003-10-22 17:06:27 UTC
The solution mentioned in the kate bug would at least help, except that the kate plugin in kdevelop seems to do the exact opposite of what is claimed in the kate bug. Kdevelop places the cursor at the bottom of the screen instead of the top. Also, while using kdevelop, I can find no place where the 'user can specifiy the amount of lines which the cursor should always stay away from the border' as mentioned in that same bug.
Comment 4 Jens Dagerbo 2003-11-03 20:13:06 UTC
Hmm.. "cursor should appear in more or less the same place as before reformat" is actually implemented, and works here when I try it.

It doesn't work on KDE-3.1?
Comment 5 Robert Shideleff 2003-11-03 20:54:47 UTC
At least not as of Alpha7. I haven't yet been able to get beta 1 to compile under gentoo to try it.
Comment 6 Robert Shideleff 2003-11-04 01:37:46 UTC
If I switch to the QT editor, the centering feature works much better. Also, there is better support for debugging in the QT editor. Unfortunately I lose a lot of cool features of Kate.
Comment 7 Hamish Rodda 2003-11-28 12:56:08 UTC
Kate's behaviour has been updated in CVS head.  Now, if the new location is off the screen, your cursor is centered, otherwise your cursor is just moved.  I think this is the best policy Kate can have without an extended api, and I at least Christoph agreed :)

Also note that in kate cvs head you can specify an arbitrary number of lines that you want to be visible top and bottom of the screen at all times, ie. the cursor never gets to the absolute top/bottom (unless at the top/bottom of the file).  Try it out, it's neat: Editing -> Autocenter Lines.

These changes should satisfy the reporter's wishes.

Sorry about our bad track record with this behaviour... I've been meaning to fix it for ages :)

Regards,
Hamish.
Comment 8 Jens Dagerbo 2003-11-28 14:38:44 UTC
Yes! It really centers!! Thank you, thank you, thank you!! :D

Comment 9 Hamish Rodda 2003-11-29 09:56:15 UTC
*** Bug 66644 has been marked as a duplicate of this bug. ***
Comment 10 Robert Shideleff 2003-12-10 20:19:08 UTC
Did this fix make it into kdevelop Beta 2? Do I have to download Kate HEAD to see this fix? (Right now I just have whatever version of Kate is included with KDE 3.1.latest)

In Gentoo with Beta 2, I don't see the fix: It still behaves the way it always did, and there is no 'Autocenter' option in the editor parameters.
Comment 11 Jens Dagerbo 2003-12-10 22:15:29 UTC
Yes, that is correct. This is a behavioral change of katepart, and it is only implemented in the 3.2 branch (it should have made beta 2, I think).