Flexible 'alignment' function

Ideas for new features

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

Post Reply

How important is it to you, to have this feature implemented into future versions of TextPad?

Important, even if the size/efficiency of TextPad increases/degrades
13
48%
Somewhat important
9
33%
I'm okay either way
3
11%
Somewhat unimportant
2
7%
Unimportant, even if the size/efficiency of TextPad remains unaffected
0
No votes
 
Total votes: 27

Nial
Posts: 29
Joined: Fri May 09, 2003 12:04 pm

Flexible 'alignment' function

Post by Nial »

When writing code/VHDL (I'm a hardware designer) it's imortant to make things neat and readable. Part of this can involve vertically aligning lists, or series of assignments.

An example....

port map(
wraddress => ram_wr_address,
data=> ram_din,
wren=> ram_1_wren,
wrclock=> clk,
wrclken=> enabled,
rdaddress => ram_rd_address,
rdclock=> clk,
rden=> enabled,
rdclken=> enabled,
q=> ram_1_dout
);

isn't nearly as easy to scan as

port map(
wraddress.....=> ram_wr_address,
data..............=> ram_din,
wren.............=> ram_1_wren,
wrclock.........=> clk,
wrclken.........=> enabled,
rdaddress.....=> ram_rd_address,
rdclock..........=> clk,
rden.............=> enabled,
rdclken.........=> enabled,
q..................=> ram_1_dout
);

(I've had to put in '.'s so the spaces aren't cut out, and this is badly aligned but I hope you get the jist)

...and these are two very short examples, with much longer lists it can take ages getting things tidy.

Prism (that I mentioned below) has an 'alignment' feature where you can select a block of text and what's being aligned ( => in the example above) and it simply right justify aligns all the examples to the one farthest to the right. The ability to select what's used for the alignment allows this function to be used in all sorts of situations.

This shouldn't be hard to implement, but can save a _lot_ of time.

Go on, you know you want it....
CJ
Posts: 17
Joined: Thu Apr 24, 2003 10:37 pm
Location: Vancouver, BC, Canada

Post by CJ »

    I agree with you. This would be a great feature. I've tried to use the tab settings within the document class options to achieve something similar but without success.
    User avatar
    Angantyr
    Posts: 11
    Joined: Mon May 05, 2003 5:45 pm

    Post by Angantyr »

    That type of alignment would come in handy for us software engineers as well in variable declaration sections.
    Christopher_G_Lewis
    Posts: 10
    Joined: Thu May 08, 2003 6:56 pm

    Post by Christopher_G_Lewis »

    As a kind of work around, I use a combination of Replace, Block Edit Mode, and Shift Tab.

    Highlight the block, S&R the text that you want moved (in your case, S&R '=>' to '........=>' (... = lots of spaces)

    Switch to Block edit mode (ctrl-shift-f8)

    Highlight where you want your first => down to the last line (make it acouple of chars wide)

    Shift Tab, will highlight all the lines to EOL, and move them to the begining of where you highlighted.

    Remember to turn of Block Edit

    It's kind of hard to explane, but it does work.
    Nial
    Posts: 29
    Joined: Fri May 09, 2003 12:04 pm

    Post by Nial »

    > It's kind of hard to explane, but it does work.

    Hmm, it doesn't sound very convenient if you've a fair bit
    of tidying to do.

    There's a demonstration of the Prism feature here...

    http://www.iol.ie/~dmurray/Prism/Columnize.html

    Much easier to use.

    Nial.
    SecondToughest
    Posts: 5
    Joined: Wed Jun 04, 2003 2:39 pm

    Post by SecondToughest »

    ok, that's frickin awesome. I cut/paste using block mode to achieve this type of effect currently, but this would be way more efficient.

    ST
    User avatar
    trids
    Posts: 69
    Joined: Wed May 07, 2003 10:16 am
    Location: South Africa

    Post by trids »

    I changed my mind (thanks for the link to the demo Nial!) ... and wish I could change my vote too!
    Post Reply