Whole Tomato Software Forums
Whole Tomato Software Forums
Main Site | Profile | Register | Active Topics | Members | Search | FAQ
 All Forums
 Visual Assist
 Feature Requests
 Smarter comment auto-adds on / character

You must be registered to post a reply.
Click here to register.

Screensize:
UserName:
Password:
Format: BoldItalicizeUnderlineStrikethrough Align leftCenterAlign right Insert horizontal ruleUpload and insert imageInsert hyperlinkInsert email addressInsert codeInsert quoted textInsert listInsert Emoji
   
Message:

Forum code is on.
Html is off.

 
Check to subscribe to this topic.
   

T O P I C    R E V I E W
foxmuldr Posted - Sep 30 2014 : 08:33:01 AM
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
3   L A T E S T    R E P L I E S    (Newest First)
feline Posted - Sep 30 2014 : 5:46:32 PM
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
foxmuldr Posted - Sep 30 2014 : 1:44:37 PM
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
feline Posted - Sep 30 2014 : 12:17:54 PM
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.

© 2023 Whole Tomato Software, LLC Go To Top Of Page
Snitz Forums 2000