Skip to main content



      Home
Home » Language IDEs » Java Development Tools (JDT) » Vertical scroll beyond content
Vertical scroll beyond content [message #1815256] Fri, 27 September 2019 18:17 Go to next message
Eclipse UserFriend
Is there a setting which allows me to scroll beyond the end of the file?

I'd like to get the last few lines of the source file up near the middle / top of the screen.
Re: Vertical scroll beyond content [message #1815259 is a reply to message #1815256] Fri, 27 September 2019 22:28 Go to previous messageGo to next message
Eclipse UserFriend
No. (And I don't know of any editor that does this.)
Re: Vertical scroll beyond content [message #1815261 is a reply to message #1815259] Fri, 27 September 2019 22:42 Go to previous messageGo to next message
Eclipse UserFriend
Ed Merks wrote on Sat, 28 September 2019 02:28
No. (And I don't know of any editor that does this.)


Do you mean you don't know of any plugin-editor for Eclipse? Or any editor in general?

This may be the first patch I offer to the Eclipse project. :-)
Re: Vertical scroll beyond content [message #1815262 is a reply to message #1815261] Sat, 28 September 2019 00:05 Go to previous messageGo to next message
Eclipse UserFriend
I don't know of any editor in general that does this.

I believe that to implement such a thing would need to be supported at a very low level in SWT's native widgets and it would need to work across Windows, Linux, and Mac. Likely it only needs to work in org.eclipse.swt.custom.StyledText to work in the Eclipse editors, but that still needs attention across all OSes. And of course you'd have to get folks to agree this is a desirable thing because it will create confusion about how many blank lines are actually at the end of the underlying resource's contents; so likely it would need to be controlled by a preference... You're very like to invest weeks of effort in such a task and should be prepared to test across multiple OSes.
Re: Vertical scroll beyond content [message #1815266 is a reply to message #1815262] Sat, 28 September 2019 08:51 Go to previous messageGo to next message
Eclipse UserFriend
Hi

For text editors just typing a few blank lines at the end of the file will suffice. For JDT the clean up actions should lose the blank lines even if you try to save them.

Similar to Ed Merks' caution: If you try to develop a patch, I would suspect that you will need to solve many problems where it is 'known' that the cursor position cannot be outside the file, and once you fix those you may find that the developers are not enthusiastic about your changed semantics and so reject it anyway; the change in editor semantics risks rippling into all derived third party editors.

Regards

Ed Willink
Re: Vertical scroll beyond content [message #1815270 is a reply to message #1815262] Sat, 28 September 2019 18:16 Go to previous messageGo to next message
Eclipse UserFriend
Ed Merks wrote on Sat, 28 September 2019 04:05
I don't know of any editor in general that does this.

I believe that to implement such a thing would need to be supported at a very low level in SWT's native widgets and it would need to work across Windows, Linux, and Mac. Likely it only needs to work in org.eclipse.swt.custom.StyledText to work in the Eclipse editors, but that still needs attention across all OSes. And of course you'd have to get folks to agree this is a desirable thing because it will create confusion about how many blank lines are actually at the end of the underlying resource's contents; so likely it would need to be controlled by a preference... You're very like to invest weeks of effort in such a task and should be prepared to test across multiple OSes.


There are lots of editors which do this. Some have indicators that say something like "[*** End of File ***]" in a near-back-color color so it doesn't stand out intently, but is a reference.

I haven't been able to figure out how to modify the source code for the debug issue I have in the other thread.

Will check out org.eclipse.swt.custom.StyledText.

UPDATE: I found it, and went to set a breakpoint, but the build has errors now when I get latest. Not sure if it's my setup or the nature of using a build in active development?

[Updated on: Sat, 28 September 2019 18:57] by Moderator

Re: Vertical scroll beyond content [message #1815371 is a reply to message #1815270] Tue, 01 October 2019 11:55 Go to previous message
Eclipse UserFriend
I've located the code. StyledText has a scroll(int, boolean) function and a calculateTopIndex() function that seem to be limiting the scroll ability. Also, there seems to be scrollbar logic that determines the position of the scrollbar relative to the maximum content-size, rather than the maximum content-size + (one additional visible screen less one row).
Previous Topic:Suspend VM not resuming on F6 or F8
Next Topic:Australian ABN validation
Goto Forum:
  


Current Time: Sun Aug 31 03:57:32 EDT 2025

Powered by FUDForum. Page generated in 0.05049 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top