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 and multi-line string constants
 New Topic  Topic Locked
 Printer Friendly
Author Previous Topic Topic Next Topic  

ivan
Ketchup Master

Russia
75 Posts

Posted - Aug 15 2004 :  09:23:05 AM  Show Profile
Suppose I have a following piece of code:

    const char * psz = "\this is \a multiline string";


If I cut the 2 lines starting from 'this is' and then paste them back, they get indented, so the string gets several tabs inserted into it. I think VA X should recognize such situations...

Uniwares
Tomato Guru

Portugal
2322 Posts

Posted - Aug 15 2004 :  09:28:44 AM  Show Profile
This is not a issue of VAX, but VS. VAX does not format your code, but your IDE does.
Go to Top of Page

ivan
Ketchup Master

Russia
75 Posts

Posted - Aug 15 2004 :  09:53:01 AM  Show Profile
Damn, for some reason I thought it was VAX formatting code after paste. Guess I've been using it for too long ;)

Okay, in that case I'm curious if it's possible to teach VAX to fix it. Maybe this belongs to the 'suggestions' forum, though.
Go to Top of Page

Ondrej Spanel
Senior Member

40 Posts

Posted - Aug 16 2004 :  06:39:07 AM  Show Profile
quote:
Originally posted by Uniwares

This is not a issue of VAX, but VS. VAX does not format your code, but your IDE does.



I think WAX does it - there is a VAX option Format after Paste in Text Editor/C++ category.
Go to Top of Page

Cezariusz
Tomato Guru

Poland
244 Posts

Posted - Aug 16 2004 :  06:46:46 AM  Show Profile
VA X just calls IDE formating engine after paste.

Cezariusz Marek
https://midicat.net/
Go to Top of Page

Stephen
Tomato Guru

United Kingdom
781 Posts

Posted - Aug 16 2004 :  06:52:04 AM  Show Profile
Lots of people get confused about this. Maybe the text could be reworded to make it clearer that the IDE is doing the formatting.

Stephen Turner
ClickTracks http://www.clicktracks.com/
Winner: ClickZ's Best Web Analytics Tool 2003 & 2004
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
19021 Posts

Posted - Aug 16 2004 :  07:01:22 AM  Show Profile
quote:
Originally posted by ivan

Okay, in that case I'm curious if it's possible to teach VAX to fix it. Maybe this belongs to the 'suggestions' forum, though.



this has been requested before. it doesn't look likely, since the whole question of how to format code is a very personal thing. imagine the number of options to satisfy everyone still, it would be nice

you may want to check out GC, which is a free tool to format your C and C++ code.

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

Stephen
Tomato Guru

United Kingdom
781 Posts

Posted - Aug 16 2004 :  07:52:57 AM  Show Profile
I agree that VAX shouldn't try and format code to satisfy everyone's personal styles, but ivan's example is not in that category. His code is reformatted in such a way that it is syntactically different afterwards, which is a clear bug. Now it's a VS bug, not a VA bug, and I'm not sure that VA should get into fixing it. But it's not the usual request.

Stephen Turner
ClickTracks http://www.clicktracks.com/
Winner: ClickZ's Best Web Analytics Tool 2003 & 2004
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
19021 Posts

Posted - Aug 16 2004 :  08:40:24 AM  Show Profile
very true, i didnt read the first post as carefully as i should have

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

ivan
Ketchup Master

Russia
75 Posts

Posted - Aug 16 2004 :  6:03:07 PM  Show Profile
Oh well, I can live with it. In a couple of days I'll be done with those obnoxiously long sql query strings anyway, and then maybe they'll fix it in VS 2005.

"Writing a code formatting tool that satisfies everyone's personal styles"... what a horrifying thought. Programmers who demand such tools from other programmers should be neutered. ;)
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
19021 Posts

Posted - Aug 17 2004 :  05:51:34 AM  Show Profile
when i write very long SQL queries i format them like this:


    char szBuffer[200];
    sprintf(szBuffer, "SELECT * FROM"
        " main_table WHERE"
        " record_number=25");

this way i dont have to worry about the effects of indenting. really down to personal preference though.


i am pleased to report the code formatting tool already exists under UNIX, long live vim

in fact, if it wasnt for VAX, i would still be writing my windows code in vim for windows

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

support
Whole Tomato Software

5566 Posts

Posted - Aug 18 2004 :  6:30:54 PM  Show Profile
Workaround, aside from writing as feline suggests, is to disable "Format after every paste" in the VA X options dialog.

http://www.wholetomato.com/products/features/format.html?more=yes
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Topic Locked
 Printer Friendly
Jump To:
© 2023 Whole Tomato Software, LLC Go To Top Of Page
Snitz Forums 2000