Bug 149603 - [typing] Editors in Eclipse to support elastic tabstops
Summary: [typing] Editors in Eclipse to support elastic tabstops
Status: ASSIGNED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: Text (show other bugs)
Version: 3.2   Edit
Hardware: All All
: P5 enhancement with 20 votes (vote)
Target Milestone: ---   Edit
Assignee: Platform-Text-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on: 318356
Blocks:
  Show dependency tree
 
Reported: 2006-07-04 18:17 EDT by Martin Vlk CLA
Modified: 2020-03-12 09:23 EDT (History)
13 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Martin Vlk CLA 2006-07-04 18:17:34 EDT
It would be really cool if the editors in Eclipse supported the "elastic tabstops" as per http://nickgravgaard.com/elastictabstops/
I would imagine this to be the third option in addition to the existing "tabs" and "tabs as spaces" modes.
Comment 1 Tom Hofmann CLA 2006-07-05 12:04:33 EDT
The idea of 'elastic tab stops' has some appeal indeed.

Its main benefit is the automatic alignment of what I would call "inner tabs", i.e. tabs that do not occur in the whitespace at the beginning of a line, but rather inside the line. An example are aligned fields (behind type names) or aligned line end comments.

I see the following drawbacks:
- it still assumes that multiple tabs are used to create the leading indentation of a line. This is by far the most frequent use of tabs and spaces, and the proposal does not have any advantage for leading indents.

- it does not help with column-alignment where the alignment anchor is not a tab. Consider the alignment of the second parameter in the following fragment. How would one define a tab-stop here?

    void method(int paramOne,
                int paramTwo) {
    }

- the elastic tab proposals groups lines into blocks (lines without blank lines in between) to avoid having a single long line making the tab stops of the entire file to be far off to the right. This is a good assumption for demonstrating the proposal, but will fail in the real world, where one will occasionally have a long line containing a tab that will mess up the entire block. Consider the following fragment - the code section would be moved way too far to the right:

   if (looooooooooooooooooooooong > conditiooooooooon) {	// comment
   	code();


-- 

In short, I think the problem is the following: Tab stops are indeed a mental concept that the programmer uses to format code. However, tab stops have no representation in a text file (as opposed to word processor documents). Therefore, the programmer uses tabs and spaces to create the illusion of tab stops, with the drawback of having to maintain them himself.

The elastic tabs proposal tries to guess the user's intention and insert the tab stops automatically, but can of course not be entirely correct in its guess.

I believe this could be compared to formatting, which is a generalization of maintaining tab stops. While some users would like auto-formatting on every key-press (or at least save), most probably would not.
Comment 2 Dani Megert CLA 2006-07-06 06:40:43 EDT
Another problem is that typing can get very noisy as the text around you changes while typing in new text. This is usually considered bad for good reasons.

Before we can continue on this bug we have to wait for bug 4866. We are currently not planning to push for bug 4866 since we don't intend to work on this item for now. Should someone consider to commit resource for this enhancement we can start negotiating with SWT.
Comment 3 Aaron Digulla CLA 2006-07-06 15:13:44 EDT
To avoid the jumping text, word processors put tabs at certain offsets. For example, put a tab stop only at multiples of 100 pixels. This way, the text will only jump after 100 pixels are used up.
Comment 4 Dani Megert CLA 2006-07-07 06:55:18 EDT
Yep, but this would probably have to be per file and hence this information would have to be stored somewhere.
Comment 5 RasmusP CLA 2006-07-10 09:01:11 EDT
It looks like the author's just improved the system a bit. From the website at:
http://nickgravgaard.com/elastictabstops/

"The result is a system that doesn't need all the blank lines that the first version did and makes better use of horizontal space. It also minimises the amount of text that moves on other lines when text is modified."
Comment 6 Dani Megert CLA 2007-06-22 09:59:29 EDT
Get rid of deprecated state.
Comment 7 Nick Gravgaard CLA 2009-06-06 15:22:48 EDT
This bug does not depend on 4866, but on 279356. Could someone change the dependencies?
Comment 8 exceptione CLA 2010-05-08 15:50:52 EDT
(In reply to comment #7)
> This bug does not depend on 4866, but on 279356. Could someone change the
> dependencies?

That bug (#279356) seems to be fixed for some time. Could we conclude the road to implementation is paved now?

I have worked with Nick Gravgaard's work and I am totally convinced. Languages like haskell will greatly benefit, since horizontal layout in such languages is even more important than in OOP/procedural languages.
Comment 9 Annan CLA 2012-03-21 11:59:37 EDT
This post on stackoverflow (http://stackoverflow.com/a/6301717/2118) says that bug 318356 is blocking Nick Gravgaard's elastic tabstop plugin for eclipse. If it's stopping him it is is probably stopping this as well.

Should it be added as a dependency to this?
Comment 10 Tyler Thrailkill CLA 2014-03-03 15:52:43 EST
This hasn't been updated in almost two years. Are we ever going to see elastic tabstops in eclipse?
Comment 11 Graeme Geldenhuys CLA 2020-03-12 09:23:46 EDT
Any possibility of seeing Elastic Tabstops in Eclipse?