Community
Participate
Working Groups
Build Identifier: Most lines of Java are indented at least one level, very few lines of code appear with zero indent. Therefore, to save horizontal space it may be possible to reduce the display of all indented text by one level with minimal impact on usability, by starting indent levels at -1. This means that top-level indented code will actually be displayed to the _left_ of the edit window, covering the line numbers. The hidden line numbers are very easily inferred by looking at the previous and next line numbers. Before you revolt, please see the attached screenshot mockup. For users with a vertical monitor (turned the monitor on its side to see more lines of code) those four extra characters sure would help! Reproducible: Always
Created attachment 209168 [details] Mockup This mockup shows the proposed changes to the editor window. The only inconvenience to the coder is that the line number for line 9 is hidden. It is, however, easily inferred.
If you're inferring something, you're not entirely sure. In the mockup, when mixed with the code folding, there's no way to tell what line the visible import statement is on. What you'd probably want, instead, is a way to have the horizontal scrollbar increment and decrement its scrolling in chunks equal to the visible indentation's width.
> If you're inferring something, you're not entirely sure. I am entirely sure that I would like a bit more horizontal space! There are a few places where that can be had, I started with one and I will propose more. I realize that this particular proposal is rather innovative and therefore controversial. > In the mockup, when mixed with the code folding, there's no way to tell > what line the visible import statement is on. Right, and what does it matter? Seriously, if I get into a situation that I need to know what line number the import statement is on, then I expand it and I can count. More likely, Eclipse will highlight the error and I won't have to count. The convenience of having an effectively wider code pane is more than worth that! > What you'd probably want, instead, is a way to have the horizontal scrollbar > increment and decrement its scrolling in chunks equal to the visible > indentation's width. No, quite the opposite. I want to reduce or eliminate the need for the horizontal scrollbar.
There are several reasons why we don't plan to add this: - The line numbers would overlap with the whitespace characters. - The Quick Diff information would get lost for those lines where no line number is shown. - The line number ruler is not aware of any logic (e.g. code). A simple heuristic that prints the line number if there's not text would result in unreadable documents/text. We'd either have to provide a separate implementation for Java or introduce a hook where one can plug-in the heuristic. You could try to contribute your own ruler via 'org.eclipse.ui.workbench.texteditor.rulerColumns' extension point. I think it should be possible to draw into the text editor widget.