Whole Tomato Software Forums
Whole Tomato Software Forums
Main Site | Profile | Register | Active Topics | Members | Search | FAQ
 All Forums
 Visual Assist
 Technical Support
 Problem with auto indent 1540

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
Ludi Posted - Nov 10 2006 : 10:23:48 AM
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
3   L A T E S T    R E P L I E S    (Newest First)
Ludi Posted - Nov 15 2006 : 04:14:23 AM
Ah, I didn't know that. Thanks for the Tip :)
sl@sh Posted - Nov 15 2006 : 04:06:51 AM
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 :)
feline Posted - Nov 10 2006 : 10:59:09 AM
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/

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