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
 Problem with auto indent 1540
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

Ludi
New Member

8 Posts

Posted - Nov 10 2006 :  10:23:48 AM  Show Profile  Reply with Quote
Hi,

I have a small problem with the auto indent of VAX, as it doesn't really fit it my personal style. It there a possibility to modify customize that?

Here's a sample, this is how I like to my code:

	class ClientUseSkillMessage : public Message
	{
		private:
			long skillid;
		public:
			ClientUseSkillMessage(long _skillid) :
				Message(kMessageClientUseSkill),
				skillid(_skillid)
			{
			}
			ClientUseSkillMessage() :
				Message(kMessageClientUseSkill)
			{
			}
			const long SkillID() const
			{
				return skillid;
			}
			void Compress(Compressor& data) const
			{
				data << skillid;
			}
			bool Decompress(Decompressor& data)
			{
				data >> skillid;
				return true;
			}
	};


The private/public/proteced is intendent with one tab. The subparameter of the class constructor are intented too and the : is at the end of the line.

Here's what VAX produces when I type continuesly:

	class ServerUseSkillMessage : public Message
	{
	private:
		long skillid;
		bool success;
	public:
		ServerUseSkillMessage(long _skillid, bool _success) :
		  Message(kMessageServerUseSkill),
			  skillid(_skillid),
			  success(_success)
		  {
		  }
		  ServerUseSkillMessage() :
		  Message(kMessageServerUseSkill)
		  {
		  }
		  const long SkillID() const
		  {
			  return skillid;
		  }
		  const bool Success() const
		  {
			  return success;
		  }

		  void Compress(Compressor& data)
		  {
			  data << skillid;
			  data << success;
		  }
		  bool Decompress(Decompressor& data)
		  {
			  data >> skillid;
			  data >> success;
			  return true;
		  }
	};


Really annoying is the fact, that everything after the : is indented by two whitespaces (it's hard to see here, but the white spaces are there) and I don't understand why. It is actually more work to reformat the whole class than disabling VAX for the time (but then I don't have the auto completition feature, which helps with virtual functions).

And one more problem is, that when I e.g. copy and paste something with my style, VAX applies it's crappy style over it.

Help, please

feline
Whole Tomato Software

United Kingdom
18947 Posts

Posted - Nov 10 2006 :  10:59:09 AM  Show Profile  Reply with Quote
VA does not apply indenting / formatting to your code. Instead it asks the IDE to do this for it. You may want to turn off:

VA Options -> Text Editor -> C/C++ -> format after paste

When this is enable VA calls the IDE's "format code" function, CTRL-K, CTRL-F by default in VS2005 to format the selected text.

We try to avoid getting into questions of how to format code, since everyone has a different opinion and style, and we would require an incredible number of options to control the formatting. You may want to look into this code formatting tool:

http://sourceforge.net/projects/gcgreatcode/

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

sl@sh
Tomato Guru

Switzerland
204 Posts

Posted - Nov 15 2006 :  04:06:51 AM  Show Profile  Reply with Quote
One additional hint to that end: if you call the undo function after inserting autotext, this will undo all the formatting but will leave the inserted text alone. So if you generally want the code formatted, but in some cases don't like it, just press CTRL-Z in those cases and you're good :)
Go to Top of Page

Ludi
New Member

8 Posts

Posted - Nov 15 2006 :  04:14:23 AM  Show Profile  Reply with Quote
Ah, I didn't know that. Thanks for the Tip :)
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