Whole Tomato Software Forums
Whole Tomato Software Forums
Main Site | Profile | Register | Active Topics | Members | Search | FAQ
 All Forums
 Visual Assist
 Technical Support
 Indentation lost when typing dot

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
lex Posted - Apr 18 2019 : 4:36:16 PM
There's a bug when typing a dot on a new line:

{
    Foo foo;
    foo
        $
}
If you press enter after "foo" then the automatic indentation will place the cursor at $.

Typing a dot here will place it at the beginning of the line. If the "Convert dot to -> in C/C++" is disabled the dot is correctly placed at the cursor position.

This bug is especially annoying if you do method chaining like this:

{
    Foo foo;
    foo
.f1()
.f2()
.f3();
}


VS2017 15.9.11, VAX 10.9.2324.0
3   L A T E S T    R E P L I E S    (Newest First)
feline Posted - Apr 19 2019 : 08:10:26 AM
Thank you for the update. Is turning on automatic formatting causing other problems for you?

Another work around I found was that placing the semi-colon before pressing the new line helps. Since the new line is started with at least one character the indent is generated with actual tabs / spaces, rather than virtual ones, so they are preserved by VA.

There are several code formatting options in VS2017, to adjust how the code is formatted, to get it to behave how you want.
lex Posted - Apr 19 2019 : 08:04:32 AM
Ah, yes. Automatic formatting is off for other reasons but if I turn it on it works exactly like you said.

feline Posted - Apr 19 2019 : 07:01:33 AM
I am seeing the same problem here:

case=57139

Do you have:

IDE tools menu -> Options -> Text Editor -> C/C++ -> Formatting -> Automatically format statement when I type a ;

turned On or Off? If this is turned Off, does turning this On help? It doesn't stop the caret jumping to the start of the line with convert dot to -> enabled, but it does fix the formatting when you finish the statement.

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