Whole Tomato Software Forums
Whole Tomato Software Forums
Main Site | Profile | Register | Active Topics | Members | Search | FAQ
 All Forums
 Visual Assist
 Technical Support
 temporarily disable . to ->

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
Dusan Posted - Oct 10 2013 : 3:47:52 PM
Hello, I would find handy if there would be a way to temporarily (I mean without need to use settings dialog) disable . to -> behaviour.
For example it is annoying in cases when we use smart pointers such as:

shared_ptr<MyClass> mcP(MyClass::Create(...));
if (!mcP.empty())
{
  ...
}


When I write "if (!mcP.", VA X replaces "." by "->" because -> operator is overloaded, but in this case it is not wanted, so it would be fine, if for example CTRL or ALT key could disable this behaviour, so that if I press [CTRL + .], or [ALT + .], it places "." without replacing it by "->".

Is this now possible?
6   L A T E S T    R E P L I E S    (Newest First)
feline Posted - Oct 18 2013 : 11:31:08 AM
mwb1100 just turn off one or both of:

VA Options -> Advanced -> Correction -> Convert dot to -> (only in C/C++ files)
VA Options -> Advanced -> Correction -> Convert dot to -> if operator -> is overloaded

then you only have to type a single dot in all cases

Plus we would have to be a little careful handling .. in general cases, since there are times and places where you need to type "..." Not often, I know, but it does happen.
mwb1100 Posted - Oct 18 2013 : 12:13:57 AM
+1 from me as well - and you might want to consider collapsing
".." to a single "." even when the variable's type doesn't support an overloaded "->". That way you can simply get used to typing ".." in all cases.
foxmuldr Posted - Oct 17 2013 : 12:14:37 PM
I third the second-dot idea. :-)
feline Posted - Oct 16 2013 : 11:33:30 AM
The second dot is an idea we are considering, but I don't currently have an estimate for when, or if this will be done.
eduard Posted - Oct 16 2013 : 03:18:19 AM
i really like the second-dot idea.
feline Posted - Oct 10 2013 : 6:45:18 PM
Not currently. If you press Backspace the conversion will be undone, leaving you with the dot you first typed.

We are considering a feature to allow the dot to be recreated by typing a second dot:

case=1983

which would be a second method, if and when this is done.

If you only want to stop the conversion occasionally you could try disabling VA, then enabling VA again afterwards. This can be done via the VAssistX IDE menu, or mapping a keyboard shortcut to the command VAssistX.EnableDisable

If you never want VA to do this conversion for this class, then it should be easy enough to hide the overloaded operator function from VA. This simple example shows one method of doing so:

template <class T>
class SmartPtrTestHideOperator
{
public:

#ifdef VA_HELPER_CODE
#define VA_HIDE_HIDE_OPERATOR_FUNCTION SmartPtrTestHideOperator()
#else
#define VA_HIDE_HIDE_OPERATOR_FUNCTION T *operator->()
#endif
	VA_HIDE_HIDE_OPERATOR_FUNCTION
	{
		return ptr;
	}

private:
	T *ptr;
};


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