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
 Technical Support
 Indentation lost when typing dot
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

lex
Senior Member

40 Posts

Posted - Apr 18 2019 :  4:36:16 PM  Show Profile  Reply with Quote
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

Edited by - lex on Apr 18 2019 4:44:13 PM

feline
Whole Tomato Software

United Kingdom
18724 Posts

Posted - Apr 19 2019 :  07:01:33 AM  Show Profile  Reply with Quote
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.

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

lex
Senior Member

40 Posts

Posted - Apr 19 2019 :  08:04:32 AM  Show Profile  Reply with Quote
Ah, yes. Automatic formatting is off for other reasons but if I turn it on it works exactly like you said.

Go to Top of Page

feline
Whole Tomato Software

United Kingdom
18724 Posts

Posted - Apr 19 2019 :  08:10:26 AM  Show Profile  Reply with Quote
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.

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