gpt4 book ai didi

eclipse - 如何让 Eclipse 滚动到文档底部?

转载 作者:行者123 更新时间:2023-12-03 05:50:28 28 4
gpt4 key购买 nike

当我在 Eclipse 编辑器滚动到打开文档的底部时,最后一行位于文件的底部。在文件/屏幕的底部编辑代码时,这有点烦人。

如何使 Eclipse 能够向下滚动(很像 Vim 或 VS)足够远,以使最后一行代码到达编辑器窗口的顶部?

我在Eclipse中要求这个问题的反面:How to make Visual Studio editor stop scrolling past bottom of a file?

最佳答案

考虑到滚动条的当前实现,这是不可能的。
(参见org.eclipse.swt.widgets.ScrollBar.java)

At any given moment, a given scroll bar will have a single 'selection' that is considered to be its value, which is constrained to be within the range of values the scroll bar represents (that is, between its minimum and maximum values).

在 JDT(Java 编辑器)领域,范围与源文件的行数密切相关。
添加人工“逻辑行”以允许滚动超过最后一行会对 JDT 的许多其他部分产生意想不到的后果,这些部分与基于源文件的行号显示信息相关(例如编译错误红色下划线)。

这也是为什么这些编辑器中没有软包装,尽管一个7-years old bug 35779 (得票最多的之一)。

Allowing word/soft wrap in the editor while typing is easy but not enough, a mapping between the model lines and the visual lines must be introduced to e.g. correctly show annotations.
It also introduces various problems that need to be solved, e.g. 'Go to Line': tools like a debugger, compiler etc. will report the model line but a user it will look strange that a different line will be selected than the one entered into the 'Go to Line' dialog

所以现在,SWT scrollbar example仍然受到窗口底部的限制:

http://www.java2s.com/Code/JavaImages/ScrollBarExample.PNG

关于eclipse - 如何让 Eclipse 滚动到文档底部?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2197218/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com