Elastic tabstops - a better way to indent and align code
Support for more editors in the works
Sunday 2009-06-07 19:31 UTC
Visual Studio 2010Following my last post last year (I really should try and post more frequently), someone from the Visual Studio development team at Microsoft got in contact with me (thanks Noah!). It looks like I will be able to implement elastic tabstops in Visual Studio after all, since VS 2010 should allow me to set non-uniform tabstops on different lines. I think I'll wait until the final version's released before I do anything else.
Eclipse
I had a look into what it would take to get elastic tabstops working on Eclipse. Unfortunately it looks like SWT (the toolkit Eclipse uses) will not let one set non-uniform tabstops on different lines, which is a pre-requisite for the implementation of elastic tabstops. If you're an Eclipse developer (or feel like creating an account) you can vote this bug up here.
NetBeans
In contrast with Eclipse, NetBeans uses Swing, which is a toolkit that already supports the implementation of elastic tabstops (as can be seen in my demo applet here). When I get time I'll try and look into writing a plugin for this IDE.
Another editor supports elastic tabstops - Code Browser
Marc Kerbiquet emailed me last month to tell me that he'd added elastic tabstops to his editor: Code Browser. He's also written a rather nice advocacy page. Since it's cross platform this is probably the first editor to support elastic tabstops that runs on Windows. (There's also Gedit on Windows, which I'd like to see get more attention.)
Plans for an editor of my own
I'm planning to start work on a new cross-platform editor which will of course support elastic tabstops. I have a few innovations I'd like to try, but I also intend to borrow ideas from the best, and I'll also make it scriptable so people can extend it as they see fit. The reason for this is that changing every single editor that exists is impossible, but by making an easily scriptable cross-platform editor which supports elastic tabstops from the start it should be possible for people to script it to feel like their favourite editor. Watch this space...
13 comments
Tuesday 2009-06-16 20:50 UTC
David <david DOT regev AT gmail DOT com>
Nick, I think your idea is brilliant. I look forward to your progress. Regarding the innovations you'd like to try, I have an idea that I think is right up your alley and in line with the goal of elastic tabstops.
Say I have a long indented line in an HTML document (the pipe indicates the end of the visible part of the line):
→ <p>The quick brown fox jumps over |the lazy dog.</p>
This, obviously, can get pretty annoying. To avoid this, I can enable word-wrapping in my text editor:
→ <p>The quick brown fox jumps over ↲
the lazy dog.</p>
which disrupts the flow of the document and its semantic indentation, making it quite hard to read. Alternatively, I can hard-wrap the text:
→ <p>The quick brown fox jumps over ΒΆ
→ the lazy dog.</p>
which is hard to maintain and uses the line feed and following tab in a completely nonsemantic manner. This choice between two evils has bothered me for a long time, until I realized that there is a third, more humane, option: the text editor should wrap to the last inserted tab in that line:
→ <p>The quick brown fox jumps over ↲
→ the lazy dog.</p>
So, just like elastic tabstops solve the tab vs space issue by making tabs more semantic, this idea would solve the soft-wrap vs hard-wrap issue by making line feeds more semantic. In essence, your innovation would be expanded from "elastic tabstops" to "semantic whitespace".
As far as I know, the only editors that implement this are Kate and KWrite, which call it "Dynamic Word Wrap" (though they wrap to the first set of tabs, rather than to the last tabstop). I would love to see this implemented in your gedit plugin. (I even found a Mozilla bug with this idea: https://bugzilla.mozilla.org/show_bug.cgi?id=312716 .)
So, what do you think?
Monday 2009-06-22 13:59 UTC
Nick
I like that feature too, and I've seen it in a few editors before. I won't be adding it to the elastic tabstops plugin though as I think it's different functionality and should be in a separate plugin.
Friday 2009-06-26 14:20 UTC
David <david DOT regev AT gmail DOT com>
Nick, other than the two editors that I mentioned (Kate and KWrite), what other editors have you seen that have this? I've found it quite difficult to search for this feature, so I would not at all be surprised if it's more common than I thought.
As I pointed out, those two editors wrap only to the opening tabstop of that line, rather than to the last tabstop on the line. They fail to account for elastic tabstops and their semantic nature. A properly-written "Dynamic Word Wrap" plugin would take your plugin into account and would work with it. The table-like layout that your plugin allows would only be enhanced.
I really think that the two features compliment each other and go hand-in-hand. That's why I suggested this idea to you. Do you think you might be able to create such a plugin in the future?
Thanks.
Sunday 2009-06-28 19:06 UTC
Nick
I think I've seen this feature on an editor called Crimson Editor on Windows, and I would expect Emacs could do this as well as possibly Vim.
While this won't be part of my elastic tabstops plugin for Gedit, I plan to write my own editor at some point, and since this is a feature I've always liked I'll try and add it to that.
Monday 2009-06-29 07:08 UTC
David <david DOT regev AT gmail DOT com>
Indeed, Crimson Editor does support what it calls "natural word wrapping". Of course, it does not work in the table-like manner that I described. I hope you will be able to do that in your own editor.
I did some more searches, and it seems that I'm not the only one dying for this feature. This guy[1] went on a quest for a text editor that has it, finding only Kate. Someone asked for it on Stack Overflow[2] as well. And bugs have been filed both on Launchpad[3] and GNOME's Bugzilla[4].
Thanks for the references. I look forward to trying your editor when its ready.
[1] http://null.maimed.org/articles/questfortheeditor.shtml
[2] http://stackoverflow.com/questions/662823/text-wrapping-in-gedit
[3] https://bugs.launchpad.net/gedit/+bug/318517
[4] http://bugzilla.gnome.org/show_bug.cgi?id=559132
Wednesday 2009-11-04 08:43 UTC
Graeme Geldenhuys <graemeg AT gmail DOT com>
Hi David,
Lazarus IDE and Delphi IDE has supported what you suggest for years already. It's called "auto indent" or "smart tabs" in Lazarus.
Friday 2010-01-08 20:54 UTC
Dan Bernier <danbernier AT gmail DOT com>
Hello Nick, any word on the VisualStudio 2010 plug-in?
Wednesday 2011-10-19 07:06 UTC
Karl Ostmo <kostmo AT gmail DOT com>
I would love to help with any effort to implement Elastic Tabstops in Eclipse. Has anyone started this effort? Judging from the Eclipse Bugzilla reports, it looks like the way is paved to begin.
Saturday 2012-07-14 04:53 UTC
Bala <rbz5 AT excite DOT com>
Fact remains, C4EVA and his mkneoy gang, already tried to introduce a pay-per-drive system. Charging 45USD per key (foundmy.com). And the LT firmware which would only work on the firmware it was bought for, luckily LT was easily cracked due to the poor implemention of encryption (LOL). So they don't really care much about the people in the scene, they're in it for the money.All releases are timed according to their maximum profit scheme, so surely firmwares are held back in order to accomodate for hardware releases. All in conjunction, Jungleflasher, TX, C4eva. Sure they bring us free firmware and great tools and hardware. But if they had the chance to have an exclusive payperkey system it would have been done.Competition like X360key is nice, I hope it's better than this firmware so the monopolized hacked firmware business for Xbox 360 is over. Probably JF/TX/C4eva will come out with a similar device as the X360key now that their monopoly is about to end. I hope X360key is the end of burning discs and patching ISO's over and over like we have to endure with this firmware hacking bulls**t.
Saturday 2012-07-14 23:41 UTC
wijfcrb <oymlfn AT zreryt DOT com>
GKHHLQ bzingsenweab
Sunday 2012-07-15 06:26 UTC
vcxsrsksl <rirhva AT cvxcta DOT com>
xpTLSh , [url=http://kjxzvfnxuirj.com/]kjxzvfnxuirj[/url], [link=http://doghahuxofvs.com/]doghahuxofvs[/link], http://vvtfmehgxqch.com/
Monday 2012-07-16 08:17 UTC
kppccn <uqadic AT mtapqe DOT com>
XYyc8p qrwasrscguvh
Monday 2012-07-16 13:10 UTC
ujpvtraobmv <garvjf AT uzebkm DOT com>
C40fZl , [url=http://tntgbfbyflwe.com/]tntgbfbyflwe[/url], [link=http://norvfefuxhcz.com/]norvfefuxhcz[/link], http://zufoulbfvzko.com/
Leave a comment
Note that all tags will be removed from the comment field, so use < and > to do < and >. Also note that the (optional) email address will be displayed with "@" and "." replaced with " AT " and " DOT " respectively.