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

标签 eclipse configuration ide editor

当我在 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/

相关文章:

windows - Eclipse 颜色主题和 OS L&F

android - 如何使用 MOTODEV 从 Android 中的 MapActivity 扩展 Activity ?

javascript - Node.js 配置文件与 .env 架构实践和构建模式

reactjs - 如何直接从 VSCode 运行和调试 React 应用程序?

visual-studio - 安装 VS 2017 时出现错误

eclipse - Eclipse PDT 3.6 Helios,切换注释的键盘快捷键不再起作用

java - 在 Eclipse 中配置字符串外部化以使用 ${key} 作为字段名称

eclipse - Eclipse 中的排序方法

hadoop - 强制 Hadoop 运行具有多个 reducer 的应用程序

delphi - 如何检测特定的 Delphi IDE 是否正在运行?