Is it possible to do this editor formatting

Is it possible to do this editor formatting

Post by Martin » Wed, 24 Jun 2009 21:08:28


I am relatively new to using Visual Studio 2008 and have the following
questions:

I am using it to write C++ code and would like it to show the matching brace
(or bracket) when I place the cursor on it.

I can get it to display the matching brace with a colour when I am typing
the code in, but it does not show it with just the cursor on it. I have to
delete the brace and re-enter it again for the matching one to be displayed.
Not ideal really.

Also, how is it possible to get the current line (on which the cursor
resides) to display with a different colour. The number of times I have done
a find - only to have to hunt for the cursor.

When using Gnat Pro to do my ADA95 programming, it gave a coloured line
between the matching BEGIN..END blocks which made tying the up very easy.
Does MS Visual Studio have something similar - I cannot find it.

Thanks for any help you can provide.

Martin
 
 
 

Is it possible to do this editor formatting

Post by Sylvain S » Wed, 24 Jun 2009 21:34:51

Martin C a rit :

with cursor just before or after a brace, type ctrl+^ to go to the
opening/closing brace (or shift+ctrl+^ to select the full block).


?!? type-in some characters, they will be inserted at the location
of the cursor - or just click where you want to insert text (knowing
where was the cursor when the only useful information is where you
want it to be is unexpected).


other editors also highlight the current line (including Eclipse & npp)
I never consider that useful, Studio doesn't provide that, but again
shift+end will select the current line (a part of it) if you want to
see it.

Sylvain.

 
 
 

Is it possible to do this editor formatting

Post by Martin » Fri, 26 Jun 2009 01:02:15

Responses written in context below:
Thanks for the responses.





I am assuming that you are using a different nationality keyboard. With the
UK keyboard, I am getting a similar response using Ctrl+].
I can use this as you suggest, I was just hoping that VS would be clever
enough to automatically highlight the corresponding braces or (possibly more
importantly) corresponding brackets as can be done with other intelligent
editors. Oh well never mind!

I think I did not explain this very well. The reason I wanted to know where
the cursor was is more for after having done a find. If I do a Find All on
an item (eg via ctrl+shift+f), I get a list of the found items in the Find
Results 1 box. If I select one of them with a double click, the window will
go to the relevant file and the cursor will be placed on the found item, As
the line is not highlighted, I have to hunt for the cursor sometimes, to
find the appropriate line. I notice that a find via ctrl+f will highlight
the found item. That would have been useful with the ctrl+shift+f find
operation I described here.
It is obviously something I will have to live with.
 
 
 

Is it possible to do this editor formatting

Post by Sylvain S » Fri, 26 Jun 2009 02:58:19

Martin C a rit :

right.


got your point, you are right again, the editor is just stupid enough
to not highlight the found token (as it does for simple serach).
the only help is that the line where token is present will be
displayed at the (vertical) middle of the window (expect if present
in the very first line of the file); still you can select the line
(ctrl+end) or the token (ctrl+shift+right) since the editor window
is selected upon double-click in the result window.

Sylvain.