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
 "Format after paste" breaks multiline editing
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

BeigeAlert
Junior Member

USA
16 Posts

Posted - Feb 10 2022 :  12:09:51 PM  Show Profile  Reply with Quote
It seems that having "Editor --> Format after Paste" enabled causes multiline editing to sometimes reformat entire lines of manually formatted code whenever trying to deselect the multiple lines.

I've created an example video here showing the issue.
https://youtu.be/hjzey5ItuiE

This is very frustrating because we use a lot of these sorts of tables throughout our code, and it's hard enough keeping them tidy. :)

If I don't survive, tell my wife "Hello".

feline
Whole Tomato Software

United Kingdom
19070 Posts

Posted - Feb 11 2022 :  10:41:06 AM  Show Profile  Reply with Quote
OK, the video shows the problem quite clearly, thank you for that, but so far I am not seeing the same problem here.

First up, Which IDE and version of VA are you using?

Next, Can you please export your VA and IDE settings and send them to me:

VA Options -> Performance -> Export Settings
IDE tools menu -> Import and Export Settings -> Export selected environment settings

I can then import them here and see if I can reproduce the problem. Please send me the files via email:

[email protected]

including this thread ID or URL in the description, so we can match it up.

I suspect that the IDE code formatting settings are important here. VA's format after paste doesn't do the formatting inside VA, instead we ask the IDE to format the code for us.

On a different front, some years ago, back when the IDE used to support macros, one of the sample macros it shipped with was designed to line up columns of text over several lines of code. So it might be worth looking to see if there is an extension to help with this. The IDE does support clang formatting rules as well, but I haven't looked into this much, and since I believe they are applied across the entire file I doubt that would be ideal for you.

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

BeigeAlert
Junior Member

USA
16 Posts

Posted - Feb 12 2022 :  2:56:22 PM  Show Profile  Reply with Quote
quote:
Originally posted by feline

OK, the video shows the problem quite clearly, thank you for that, but so far I am not seeing the same problem here.

First up, Which IDE and version of VA are you using?

Next, Can you please export your VA and IDE settings and send them to me:

VA Options -> Performance -> Export Settings
IDE tools menu -> Import and Export Settings -> Export selected environment settings

I can then import them here and see if I can reproduce the problem. Please send me the files via email:

[email protected]

including this thread ID or URL in the description, so we can match it up.

I suspect that the IDE code formatting settings are important here. VA's format after paste doesn't do the formatting inside VA, instead we ask the IDE to format the code for us.

On a different front, some years ago, back when the IDE used to support macros, one of the sample macros it shipped with was designed to line up columns of text over several lines of code. So it might be worth looking to see if there is an extension to help with this. The IDE does support clang formatting rules as well, but I haven't looked into this much, and since I believe they are applied across the entire file I doubt that would be ideal for you.



I am using Visual Studio 2019 (version 16.4.6). Visual assist version info (from "about" screen, with license line omitted):
VA_X.dll file version 10.9.2399.0 built 2021.01.26
DevEnv.exe version 16.4.29905.134 Professional
msenv.dll version 16.0.29904.37
Comctl32.dll version 6.10.18362.2037
Windows 10 10.0 1909 Build 18363.2037
36 processors (x86-64, WOW64)
Language info: 1252, 0x409

I will email you the settings you requested.

Yea it's a nightmare figuring out which formatting settings to change to get Visual Studio to behave. I have experimented with clang-format on my own personal projects, and quite enjoyed it! However, I have also noticed this same issue on my personal projects -- so this appears to be unrelated to clang-format.

If I don't survive, tell my wife "Hello".
Go to Top of Page

BeigeAlert
Junior Member

USA
16 Posts

Posted - Feb 12 2022 :  2:59:01 PM  Show Profile  Reply with Quote
Hmm... let me know if that email gets through or not. I'm seeing some attachment warnings here, not sure what actually got through.

If I don't survive, tell my wife "Hello".
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
19070 Posts

Posted - Feb 14 2022 :  07:55:14 AM  Show Profile  Reply with Quote
Sorry, no sign of anything obvious in support email. Did you get an automated response with the case number in the subject line? If not then it looks like the email didn't make it through.

Placing the settings into a zip file, or renaming them to txt files should let them pass through email without any problems.

There are so many formatting settings, especially when you start playing with clang-format as well, that that it isn't easy to simply reproduce something without the settings.

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

Uniwares
Tomato Guru

Portugal
2322 Posts

Posted - Feb 14 2022 :  08:53:02 AM  Show Profile  Reply with Quote
This seems to be limited to C++, C# does not act the same in a staged situation like this.
Also, I would recommend using https://marketplace.visualstudio.com/items?itemName=cpmcgrath.Codealignment-2019 which is excellent in aligning all the ways one can imagine.
Go to Top of Page

BeigeAlert
Junior Member

USA
16 Posts

Posted - Feb 14 2022 :  12:46:40 PM  Show Profile  Reply with Quote
Tried again, renamed the .reg file to .reg.txt. See if it comes through this time.

If I don't survive, tell my wife "Hello".
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
19070 Posts

Posted - Feb 15 2022 :  06:05:35 AM  Show Profile  Reply with Quote
I have the settings now, having a look to see if I can find out what is happening, thank you for these:

case=147840

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

feline
Whole Tomato Software

United Kingdom
19070 Posts

Posted - Feb 15 2022 :  08:21:18 AM  Show Profile  Reply with Quote
Even with your settings, I still don't know how you are getting the re-format on edit in your video. Then again, I am assuming you are using CTRL-X for cut, or DEL for delete, but maybe you are doing something else, since these are not paste commands, so should not trigger VA's format on paste setting.

But based on the effect of telling the IDE to format the selected code, I think the IDE setting you need is:

IDE tools menu -> Options -> Text Editor -> C/C++ -> Code Style -> Formatting -> Spacing -> Spacing for braces -> Preserve spaces inside uniform initialization and initializer lists = ON

which is Off in the IDE settings you sent me.

I haven't tried the code alignment extension yet, but it sounds like it will help you quite a bit as well.

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

BeigeAlert
Junior Member

USA
16 Posts

Posted - Feb 16 2022 :  10:36:16 AM  Show Profile  Reply with Quote
quote:
Originally posted by feline

Even with your settings, I still don't know how you are getting the re-format on edit in your video. Then again, I am assuming you are using CTRL-X for cut, or DEL for delete, but maybe you are doing something else, since these are not paste commands, so should not trigger VA's format on paste setting.

But based on the effect of telling the IDE to format the selected code, I think the IDE setting you need is:

IDE tools menu -> Options -> Text Editor -> C/C++ -> Code Style -> Formatting -> Spacing -> Spacing for braces -> Preserve spaces inside uniform initialization and initializer lists = ON

which is Off in the IDE settings you sent me.

I haven't tried the code alignment extension yet, but it sounds like it will help you quite a bit as well.



Aha! You are correct, setting "Preserve spaces inside uniform initialization and initializer lists" to true did the trick. Thank you!

If I don't survive, tell my wife "Hello".
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
19070 Posts

Posted - Feb 17 2022 :  06:25:41 AM  Show Profile  Reply with Quote
Excellent news, thank you for the update. I had hoped that would fix this for you.

There are a lot of IDE formatting options to consider, but reading their names, most of them didn't seem to apply to the columns, narrowing down the options to check a fair bit, thankfully. Of course, knowing that VA is asking the IDE to do the formatting helps, so you know where to look in the first place

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