Whole Tomato Software Forums
Whole Tomato Software Forums
Main Site | Profile | Register | Active Topics | Members | Search | FAQ
 All Forums
 Visual Assist
 Feature Requests
 Annoying extra parenthesis

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
znakeeye Posted - Jul 23 2008 : 06:17:52 AM
I have this:
sprintf(buf, "%d", myInt);

And want to change it into this:
sprintf_s(buf, _countof(buf), "%d", myInt);

When I have typed "_countof(buf)" I get "_countof(buf))"

Very annoying!
7   L A T E S T    R E P L I E S    (Newest First)
accord Posted - Jul 31 2008 : 3:56:20 PM
I am seeing the same effect here. Thank you for the detailed report

case=18859
znakeeye Posted - Jul 31 2008 : 04:03:39 AM
I keep expressing myself as a monkey. Sorry :P

The parenthesis appears when I explicitly type '('. Hence, the <enter> key is not the problem!

"buf" is in Clipboard

_cou<enter>    --> _countof
(              --> _countof(|)
<ctrl+v>       --> _countof(buf)
)              --> _countof(buf))

NOTE: This seems to only happen when inside another function:
sprintf(buf, | "%d", myInt); // Do the above at the cursor!
accord Posted - Jul 30 2008 : 4:47:28 PM
What is _countof in your source? For me this is a define.
#define _countof(_Array) sizeof(*__countof_helper(_Array))

This is code from the definition field.
So when I type _cou<enter> I get
_countof|

This is because parenthesis appears for functions, but not for defines.

If you type
#define SOMEDEF

void Test()
{
    SOMED<enter>
}

You should get SOMEDEF| without parenthesis. Can you please try this out?
znakeeye Posted - Jul 30 2008 : 06:39:07 AM
Sorry, my mistake. The exact way to reproduce this is (VAX 1646, VS 2008):

int myInt;
char buf[100];
sprintf_s(buf, | "%d", myInt);

Now copy 'buf' to the Clipboard and then type:
_cou<enter>(<ctrl+v>)

You get:
1: _countof(|) <--- enter-completion
2: _countof(buf) <--- pasting 'buf'
3: _countof(buf)) <--- typing ')'

Hope that helps!
accord Posted - Jul 28 2008 : 5:44:35 PM
Most strange: when I type _cou<enter> then I get
_countof|

instead of
_countof(|)

where | is the caret. Do you see the second one? Can you reproduce this in a new default test project?
znakeeye Posted - Jul 28 2008 : 06:13:29 AM
Tried it in VAX 1646. VS 2008.

I can reproduce it like so:

I believe Ctrl+V (I copied 'buf') is what's causing it!
_cou<enter><ctrl+v>) --> _countof(buf))
feline Posted - Jul 24 2008 : 12:45:25 PM
Which IDE and version of VA are you using?

If you delete the "_countof(buf)" and retype it do you see the same problem?

So far I cannot reproduce this problem.

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