Welcome to the SRP Forum! Please refer to the SRP Forum FAQ post if you have any questions regarding how the forum works.

Block Comment with Ctrl+/ Adds Asterisk and Space on Each Line

When I block-comment (Edit -> Auto Comment) code with Ctrl+/, the
start of each line gets a space following the asterisk instead of only the asterisk.
When I block-uncomment the code, the asterisks are removed but the spaces
remain.

This happens for lines that are indented with one tab (tested on tab-widths from
2 to 10). Block-commenting lines that are indented with two or more tabs does
not introduce the spurious space.

To remove the initial space is easy enough (Shift+Tab, then Tab on the block after
block-uncommenting), but it would be nice if the Ctrl+/ feature did not introduce
the space in the first place (or at least removed it when removing the asterisk).

(By the way, Ctrl-/ on unindented code also adds asterisk plus space, but block-
uncommenting the same code removes the space along with the asterisk.)

Comments

  • @vince - I need a little more information. What are your Whitespace settings in the Options dialog? Specifically:
    • Tab Width
    • Tabs as Spaces
    • Clean Tabs
  • @DonBakke - Thanks for the quick reply, Don.
    Tab Width: 4
    Tabs as Spaces: unchecked
    Clean Tabs: unchecked

    I tried now with Clean Tab checked and got the same result as before.
    The tab following the inserted * and space spans two columns (still
    ending before column 5) as expected.
  • @vince - Thanks for that. I wanted to test this using your configuration. I always have Tabs as Spaces checked and I was seeing different behavior so I wanted to see if this was connected.

    I see now what you are describing. I would consider this a bug. The addition of the space after the asterisk is expected. This is especially helpful when the code is aligned completely to the left. However, it should remove the space when you use the feature to remove the Auto Comment.

    We'll add this to our list. My primary engineer for this tool has been caught up with some other projects as of late and they have continued to multiply like tribbles. He will have to wrap these up before he can get to this.
  • @DonBakke - No problem, Don. As you find the time. It is a small matter in the overall scheme; though just to clarify, the problem doesn't appear if the initial indentation is two tabs or more.

    (I am somewhere in the middle regarding tabs and spaces. I use tabs before text because different programmers may like different tab widths; but for the same reason I have learned to use spaces after text, to preserve vertical alignments. I think I saw in some editor an option to convert only initial spaces to tabs; or maybe it was the other way around - convert tabs following text to spaces - but I can't remember where.)
Sign In or Register to comment.