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

查看:1015
本文介绍了我如何让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)

在任何给定的时刻,给定的滚动条将有一个被认为是它的值的单个选择,它被限制在滚动条表示的值的范围内(即

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

这也是为什么在那些编辑,尽管
a 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).


在输入时允许在编辑器中输入文字/软包装很容易,但不够用,映射在模型线和视线之间必须引入到例如正确显示注释。

它还介绍了需要解决的各种问题,例如。 'Go to Line':像调试器,编译器等工具将报告模型行,但是用户看起来很奇怪,将选择不同于输入到Go to Line对话框中的行。

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天全站免登陆