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

查看:152
本文介绍了如何让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?

推荐答案

考虑到当前实现的滚动条,这是不可能的。

(请参阅 org.eclipse.swt.widgets.ScrollBar.java

Considering the current implementation of a Scrollbar, this is not possible.
(See org.eclipse.swt.widgets.ScrollBar.java)


在任何给定的时刻,给定的滚动条将有一个被认为是其值的选择 e被限制在滚动条表示的值的范围内(也就是在其最小 最大值之间)。

在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).

这也是为什么这些编辑器没有软包装,尽管
a 7岁的bug 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天全站免登陆