Whole Tomato Software Forums
Whole Tomato Software Forums
Main Site | Profile | Register | Active Topics | Members | Search | FAQ
 All Forums
 Visual Assist
 Feature Requests
 Change Background for blocks into blocks

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
hoiby Posted - Dec 13 2006 : 10:48:57 AM
Often, I make some mistakes like:

if (...)
  doThis();
  doThat();
doThatToo();

or

main (){
  if (...){
   DoThis();
   DoThat();
}

or

if (......................................) DoThis();
{
  DoThat();
}


For a long time I have been looking for an editor that distinguishes the blocks's content, to quickly correct mistakes.

Here is a picture showing, a kind of visual solution.
 
3   L A T E S T    R E P L I E S    (Newest First)
feline Posted - Dec 14 2006 : 09:23:04 AM
the indenting problem, this is definitely the IDE. To prove this take the code, mess up the formatting, then select the code and trigger the IDE's format code option CTRL-K, CTRL-F by default in VS2003, you get exactly the same end result. VA stays well away from the whole "how to format my code" question.

To build on your #define point, what about people who use #define's for the start and end of namespaces, or wrap curly brackets in #if #endif blocks?

As you say, this is not as simple as it sounds.
sl@sh Posted - Dec 14 2006 : 04:04:05 AM
Talking about auto-indenting: I discovered a case where auto-indenting doesn't work properly. Not sure whether this is an issue of the IDE or VAX (I presume the former).

Here's an example:


class cMyClass
{
private:
   int m_myInt;
public:
   cMyClass(int someInt)
       : m_myInt(someInt) {}
       int get () const { return m_myInt; }
};


The problem here is the member initialization on a new line followed by an empty function body on the same line. If you put everything on the same line, it works. If you put the function body on a new line as well, it works. If you leave it like presented above, the next line (and any code following that up to the closing bracket of the class) will be indented one step too deep.

P.S.: While the above is hardly related to the topic, I thought of something else that is:
Recognizing the start and end of blocks can get tricky when using #define macros with unmatched brackets. The same goes for macros hiding 'if', 'for' or 'while' statements. (the all-time favorite MIN and MAX macros come to mind...)
feline Posted - Dec 13 2006 : 12:13:45 PM
This is where auto indent can be very useful. As soon as the indenting starts doing something unexpected, you are aware the code is not what you think it should be.

Changing the background colour is a *hard* thing for VA to do, since it does not have full control, so it is unlikely we will ever try to offer this. Plus this idea runs into a problem when you are 6, 8, or 20 blocks deep inside a function. This does happen.

In VS2003, VS2005 there is the outlining feature, this gives you visual feedback on the blocks.

To try and stop this happening in the first place try using autotext more often, so it will insert all of the brackets for you as you type the initial if statement.

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