Elastic tabstops - a better way to indent and align code
New demo of elastic tabstops solves previous version's blank line issue
Judging from the feedback I've received so far, many people liked the concept but complained that the demo implementation meant they had to insert blank lines where they wouldn't normally. Well, I've been working on this for a few days and have come up with a variation on the previous system. Whereas the original system split the text into blocks (whenever it found a blank line), lined up all of the tabs in each block and then stretched each tabstop to fit the widest piece of text in each column, the new version takes advantage of the nested nature of code. As before, it works by creating an array from the text using tabs as the delimiter, but this time it finds a column block by looping through each column individually until it finds a missing tab and then it resizes that column block to fit the widest piece of text it contains. 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.
Posted on Monday, 2006-07-10 at 13:53 UTC
Comments are closed.