Tabulator and Block Selection Mode

Hi,

when I toggle in Block Selection Mode and select at least two lines (not the whole lines, maybe only one column) and press the tab key, the whole selected lines are indented.
I would expect, that only the characters behind the selected column are indented (Like in UltraEdit).

I use this feature for example to indent the comments behind multiple code lines.

You could solve it as followed.
When in Block Selection Mode and only one Column over multiple lines is selected the tabulator will indent the characters behind the selected column.

When in Block Selection Mode and more than one column over multiple lines are selected the tabulator will indent the whole lines.

What Do you think?

Bernd

Align comments

Hi Bernd,

this is default Eclipse block selection mode behavior. We'd rather not deviate from Eclipse.

We are currently working on a better align for HDT-2.0. I'll add a feature request to also align comments.

If you need to align lots of comments, I think entering an aligned dummy character and using find/Replace with regular expressions is the only workaround. I quickly recorded a screencast that demostrates this.

Hendrik.

The feature to align comments

The feature to align comments would be perfect.

For a better readability i write my comments like in following code:

         ------------------------------------------------------------------------------
         -- wishbone state machine to access design slaves
         ------------------------------------------------------------------------------
         case s_wb_state is
            when idle =>                                                               -- ### Idle ###
               s_wb_m_out_spi.stb    <= '0'; 
               s_wb_m_out_spi.cyc    <= '0'; 
               s_wb_cnt_spi          <= (others => '0');
               s_wr_cnt              <= (others => '0');
               if (s_wb_start_spi = '1') then                                          -- when wishbone start
                  s_fetch_cnt    <= s_fetch_cnt + 1;                                   -- for fetching next data byte, increment read counter
                  s_wb_cnt_spi   <= x"01";                                             -- load wishbone counter (down - counter)
                  case s_wb_spi_sm is                                                  -- decode the command
                     when idle =>
                        s_wb_spi_sm <= wr_grant_request; 
                     when wr_grant_request =>                                          -- ### Write
                        s_wb_cnt_spi   <= x"01";                                       -- load wishbone counter (down - counter)
                        s_wb_state     <= wb_write; 
                        s_wb_m_out_spi <= set_wb(s_wb_m_out_spi, c_grant_addr, x"00", '1', cntrl); -- control write
                        s_buffer_data_out_spi(0) <= x"10";                             -- set hardware request in spi master
                        s_wb_spi_sm <= rd_grant;

Maybe you could implement that the comments will be placed at column position XX (the position could be defined anywhere), and if the written code is longer than position XX the comment is directly placed after the last character with one whitespace between.

What do you think.

Bernd

workaround

Hi Bernd, thanks for your detailed description for this feature request.

Currently, as a workaround, you can insert TAB characters in column mode by first copying a tab to the clipboard and then pasting it in column mode. I know it's not that elegant, but it works.

Cheers

Philippe

Post new comment

The content of this field is kept private and will not be shown publicly.
By submitting this form, you accept the Mollom privacy policy.