Can you disable automatic horizontal scrolling in Eclipse?

点点圈 提交于 2019-12-05 01:40:22

问题


Sometimes when I jump into source code, e.g. from search or when looking up the declaration of something, the Eclipse text editor tries to display nearby long lines by horizontal scrolling. This happens even if the item I jumped to is well within the display without scrolling. I find this rather annoying, so:

Is there a way to disable this? I have searched in vain through all the editor settings.

Specifically, this is about Eclipse CDT, but I suppose the behaviour is the same in JDT.


回答1:


This seems to happen in other eclipse editors too (like PDT for PHP)

It could have been related with the ScrolledFormText, but the Plugin Spy tells us a WorkbenchWindow class is concerned, as well as an AbstractDecoratedTextEditor, that is in essence an org.eclipse.ui.texteditor.AbstractTextEditor.

The source of that AbstractTextEditor indicates having:

  • a ScrollLinesAction for vertical scrolling
  • a TextNavigationAction for settings the cursor and potentially triggering horizontal scrolling

I am not sure how to change that behavior, except by contributing somehow to the active editor identifier (for instance, for java, "org.eclipse.jdt.ui.ClassFileEditor"), and modifying that Action.




回答2:


I was having the same issue and found these open bugs for it on the Eclipse Bugs:

https://bugs.eclipse.org/bugs/show_bug.cgi?id=314208

https://bugs.eclipse.org/bugs/show_bug.cgi?id=321189

You can prevent it from happening when you switch the Code Folding off and reload the file.

grtz,

T




回答3:


right click on your eclipse shortcut and choose properties. in compatibility tab choose "windows xp(servicepack 3). http://www.vistax64.com/vista-general/133849-disable-dynamic-horizontal-scrolling-vista.html



来源:https://stackoverflow.com/questions/594129/can-you-disable-automatic-horizontal-scrolling-in-eclipse

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!