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
 Smarter comment auto-adds on / character
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

foxmuldr
Tomato Guru

USA
384 Posts

Posted - Sep 30 2014 :  08:33:01 AM  Show Profile  Reply with Quote
I have this:


I press "/" and it gives me this, which yields a syntax error without a manual fixup:


What I really want is this, to just surround the highlighted block:


Could the auto-add comment feature only use // if the topmost line begins at offset 0 on the line? And if it's somewhere else then it will surround with /* and */? Or could an option be added to allow it to then use the "smarter" algorithm?

Best regards,
Rick C. Hodgin

feline
Whole Tomato Software

United Kingdom
18755 Posts

Posted - Sep 30 2014 :  12:17:54 PM  Show Profile  Reply with Quote
Why don't you just press * at this point? Since you want the block to be commented, and * is the key that comments the selected block, it seems the better fit.

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

foxmuldr
Tomato Guru

USA
384 Posts

Posted - Sep 30 2014 :  1:44:37 PM  Show Profile  Reply with Quote
quote:
Originally posted by feline

Why don't you just press * at this point?


That will work. I didn't know * existed because when I have this:


...and I press the / key, it gives me this:


...which actually causes me issues on a regular basis because there are several times I select from a point on a line the end and press / as part of a // sequence to add a line comment, but instead VAX surrounds the block with /* */ and then I have to delete the selected block, and then hit / again to start adding my line comment. Happens twice a month I bet. :-)

Seems like something is disconnected there in your use of * and /.

Either / should not insert the /* */ when you're within a single line (and instead one should always be required to type * to get that type of comment), or it should behave the same way on multi-line selections (meaning unless it's at the left-most column on both the starting and ending rows (indicating the entire lines are to be commented) then it would always surround with /* and */).

You could also check to see if there are any nested comments within and warn about the nesting, or if they are nested, then force the line comments.

Just some food for thought.

Best regards,
Rick C. hodgin

Edited by - foxmuldr on Sep 30 2014 1:49:48 PM
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
18755 Posts

Posted - Sep 30 2014 :  5:46:32 PM  Show Profile  Reply with Quote
I did not realise that / did that on a partial line selection, interesting. The thing is / is the "whole line" shortcut, so if you select across lines and press this key it makes sense to think that you want to comment out all of the lines. Otherwise you are forced to actually do proper full line selection before pressing /

For nested comments, press * and this will convert existing /* comments */ into / * comments * /
Pressing * again to undo the comment will undo this conversion, reverting the nested comments back into working comments once more

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