如何让 Eclipse 滚动到文档底部? [英] How can I get Eclipse to scroll past the bottom of the document?

查看:28
本文介绍了如何让 Eclipse 滚动到文档底部?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

When I scroll to the bottom of an open document in the Eclipse editor, the last line is at the bottom of the file. This is a tad annoying when editing code at the bottom of the file / screen.

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

我在 Eclipse 中问这个问题的反面:如何让 Visual Studio 编辑器停止滚动越过文件底部?

I'm asking for the reverse of this question, in Eclipse: How to make Visual Studio editor stop scrolling past bottom of a file?

推荐答案

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

Considering the current implementation of a Scrollbar, this is not possible.
(See 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 的许多其他部分产生意想不到的后果,与基于源文件的行号显示信息有关(如编译错误红色下划线).

In the JDT (Java Editor) realm, the range is strongly linked to the number of lines a source file has.
Adding artificial "logical lines" to allows scrolling past the last line would have unintended consequences on many other parts of the JDT, related to displaying informations based on the line number of a source file (like a compilation error red underline).

这也是为什么这些编辑器中没有软包装的原因,尽管一个 7 年前的错误 35779(最受好评之一).

This is also why there is no soft wrapping in those editors, despite a 7-years old bug 35779 (one of the most upvoted).

在打字时允许编辑器中的单词/软换行很容易但还不够,必须引入模型线和视觉线之间的映射以例如正确显示注释.
它还介绍了需要解决的各种问题,例如转到行":调试器、编译器等工具将报告模型行,但用户看起来很奇怪会选择与转到行"对话框中输入的行不同的行

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 滚动条示例仍然受限于窗口底部:

So for now, the SWT scrollbar example is still limited by the bottom of the window:

这篇关于如何让 Eclipse 滚动到文档底部?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆