Elastic Tabstops (end of spacing wars)

Ideas for new features

Moderators: AmigoJack, bbadmin, helios, Bob Hansen, MudGuard

Post Reply

good idea?

awesome!
3
43%
yes
1
14%
maybe
1
14%
nah.. not really
2
29%
 
Total votes: 7

qkz73
Posts: 33
Joined: Thu Jul 22, 2004 9:15 pm

Elastic Tabstops (end of spacing wars)

Post by qkz73 »

This lovely idea would be absolutely wonderful. It is not mine, but there is a link below. True tabstops for code, to align a line's elements into multiple "columns". I'd love to have an option to have TextPad load a file and display it like the example box does on the page at the url below!
http://nickgravgaard.com/elastictabstops/

An example in PHP of the type of code for which this would be extremely useful:

Code: Select all

class Example {

    // note the way that the variables line up here, and the values, and the comments
    // the idea is to NOT need physical spaces, 
    // but just one tab char and then have the TextPad software implement an elastic stop (see the url)
    protected   $myname   = "whatever";    // comment
    protected   $data     = null;          // comment
    public      $id       = 0;             // comment

    function __construct() {

        // again, note the way the key, value, and comment all line up here
        $this->data = array(
            'key'               => "long string",   // comment
            'longerkeyname'     => "str",           // comment
        );

    }
}
[/size]

This idea does require some thought and research, but I know it can be done, because the author of that url has figured out at least one viable approach. If made configurable enough, this could be useful for ALL programming languages (at least the dozen+ that I know), not just PHP or Perl or Javascript or web stuff, but Python, WSH, etc. Some other settings that TextPad would need do come to mind, like a minimum width, and perhaps a maximum number of tab chars to process as elastic stops.

One of my main reasons is that I'm one who loves to code using Verdana. For some projects, though, working with other coders who use a monospace font and align things such as below, this requires hitting the right number of spaces or tabs. So, we spend all this time hitting space and tab instead of just writing coding. Aren't we paid more than enough to focus not on byte beautification, but actual processing logic? It would be very very nice.
- QKZ -
qkz73
Posts: 33
Joined: Thu Jul 22, 2004 9:15 pm

similar idea

Post by qkz73 »

Column Indenting (very nice animation)
http://forums.textpad.com/viewtopic.php?t=10222

Sorry to spam. Hadn't noticed that idea before. Very similar in concept. I think actually, you need this idea of elastic tabstops first, and then that one could be implemented.. a UI to adjust where the elastics tabs do stop.
- QKZ -
Post Reply