Whole Tomato Software Forums
Whole Tomato Software Forums
Main Site | Profile | Register | Active Topics | Members | Search | FAQ
User name:
Password:
Save Password
Forgot your password?

 All Forums
 Visual Assist
 Feature Requests
 Whole-line comment indentation
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

studoot
Senior Member

35 Posts

Posted - Jan 07 2015 :  03:32:50 AM  Show Profile  Reply with Quote
When using the 'VisualAssistX.SelectionToggleLineComment' command, comments are added at the first column of the lines. Fine - that works successfully enough.

However, aesthetically(!), I find that the behaviour of the toggle comment in Sublime Text is much preferable; it adds the line comment prefix at the lowest indentation point of the selected lines.

To illustrate, what I mean, consider commenting out the if statement in the following code:

   while (z)
   {
      if (b < 100)
      {
         a *= 2;
         b += a;
      }
   }

With Sublime Text, I get the following behaviour on selecting the if statement and toggling line comments:

   while (z)
   {
      // if (b < 100)
      // {
      //    a *= 2;
      //    b += a;
      // }
   }


With Visual Assist, I get the following:


   while (z)
   {
//       if (b < 100)
//       {
//          a *= 2;
//          b += a;
//       }
   }

I appreciate that aesthetics are a pretty subjective thing, but there you go...

accord
Whole Tomato Software

United Kingdom
3287 Posts

Posted - Jan 13 2015 :  6:41:15 PM  Show Profile  Reply with Quote
Are you aware that you can use ctrl+k, c to comment out and ctrl+k, u to remove the comment? These are Visual Studio shortcuts (you need to hold ctrl and press k and c OR k and u) and I personally like the fact that I can use 2 different formatting styles: both VA and "Sublime Text" style with a different shortcut (you just need to press / with VA).

What do you think?
Go to Top of Page

studoot
Senior Member

35 Posts

Posted - Jan 14 2015 :  02:07:23 AM  Show Profile  Reply with Quote
quote:
Originally posted by accord

Are you aware that you can use ctrl+k, c to comment out and ctrl+k, u to remove the comment?



Yes, I'm aware of those shortcuts, but I prefer the VAX 'toggle comments' approach, as it's what I'm used to and (IMO) makes things easier - let the software do the thinking so I can concentrate on my code

Edited by - studoot on Jan 14 2015 02:07:37 AM
Go to Top of Page

accord
Whole Tomato Software

United Kingdom
3287 Posts

Posted - Jan 14 2015 :  07:16:50 AM  Show Profile  Reply with Quote
Thank you for explaining your point of view. I have put in a feature request for a new configuration option to control indentation:

case=87353

I concur.

Edited by - accord on Jan 14 2015 07:18:33 AM
Go to Top of Page

yurikus
New Member

3 Posts

Posted - Dec 21 2017 :  12:13:10 PM  Show Profile  Reply with Quote
I would like to chime in. When VA puts comment characters at the beginning of lines, it confuses VS formatting feature and VS indents commits all the way to the "correct" indentation block, creating unsightly wall of spaces. Sorely need a fix...

Go to Top of Page

feline
Whole Tomato Software

United Kingdom
19024 Posts

Posted - Dec 23 2017 :  08:01:07 AM  Show Profile  Reply with Quote
I did not realise this was happening with VS2017 formatting, thank you for pointing it out. To stop this happening, if you are not bothered by VA putting the comments at the start of the line, turn On:

IDE tools menu -> Options -> Text Editor -> C/C++ -> Formatting -> Indentation -> Preserve indentation of comments

zen is the art of being at one with the two'ness
Go to Top of Page

laeus
New Member

2 Posts

Posted - Dec 27 2018 :  12:17:23 PM  Show Profile  Reply with Quote
quote:
Originally posted by feline

I did not realise this was happening with VS2017 formatting, thank you for pointing it out. To stop this happening, if you are not bothered by VA putting the comments at the start of the line, turn On:

IDE tools menu -> Options -> Text Editor -> C/C++ -> Formatting -> Indentation -> Preserve indentation of comments



Hi, very longtime user of VAX, and I'm struggling with this myself. There doesn't seem to be an equivalent option for C#. So when I use the '/' or '*' shortcuts (which I love) and VAX puts the comment indicators "//" or "/* */" at the beginnings of their lines, then paste with formatting or insert an opening curly brace or do almost anything, that entire commented chunk slams over to the right. I'd love a VAX option that mimics the Ctrl-K,C (such an arduous key combo for something I do very frequently throughout the work day, and I'm not a fan of the alternative being to Undo every time an operation shifts a whole commented chunk over to the right).
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
19024 Posts

Posted - Dec 28 2018 :  2:18:59 PM  Show Profile  Reply with Quote
This is still in our list of things to do, so we have not forgotten this. We just have not gotten to this yet.

Have you considered changing the default IDE keyboard shortcut to something more easily used? You can do this in the IDE Options dialog, under the Environment -> Keyboard section. The trick here will be finding a keyboard shortcut that is convenient, that isn't already doing something useful that you use regularly.

zen is the art of being at one with the two'ness
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
© 2023 Whole Tomato Software, LLC Go To Top Of Page
Snitz Forums 2000