4

How can I Enable in VS8-10 the border/line that surround the codeblock where the cursor is? I have looked hard after this I kinda have to give up now. I have googled everything like: border, line, hightlight schope, and surround.

I know it's possible, I have used it before, but can't remember where to enable it.

e.g.:

if
{
    if(foo)
    {
        ________________________________________________________________
        I var s; <cursor here> // border around this and the next line I
        I var t; // border around this line too                        I
        ________________________________________________________________
    }
}
radbyx
  • 9,352
  • 21
  • 84
  • 127
  • What is the purpose of the border? When should it be shown? Should it be remembered in the solution files? – AdrianHHH Nov 20 '13 at 16:14
  • The purpose is that you can see a border for the scope of where the cursor is atm. I think it can be helpfull when working with bigger methods in some situations. – radbyx Nov 20 '13 at 16:16
  • The border updates if you move to another scope. Also note that the solution never remember anything about this. – radbyx Nov 20 '13 at 16:17
  • Visual Studio can highlight the current row. Not a border like you are describing, but you can change the background and foreground colors of the active row where the cursor is. As far as the line of code after that, I've never seen anything like that before. – Jonathan Nixon Nov 20 '13 at 16:22
  • I know it can be done, I have used it in many years on another installations, maybe it's a resharper features. Also I saw a video from Tekpub yesterday that also used it. Maybe I should add a screendump. – radbyx Nov 20 '13 at 16:26
  • I think DevExpress CodeRush is what you want. The best you can do with Resharper + VS2010 is highlight the block scope when your cursor is on the open/close brace. But not when it's next to other code within the block. – Baldrick Nov 21 '13 at 04:22

4 Answers4

6

Download "Ident Lines" in the Visual Studio Gallery or download Resharper.

For Resharper:

  1. Click "RESHARPER" in the toolbar
  2. Click "Options..."
  3. Select "Environment > Editor > Editor Appearance"
  4. Chech "Highlight matching delimiters when caret is"
  5. Check "at both sides"
  6. Check "outline"

Options

In this case, I selected the first brace after MsgBox_MouseDown. Bracing outlining

Nicke Manarin
  • 3,026
  • 4
  • 37
  • 79
3

In ReSharper Options / Environment / Editor / Editor Appearance

Enable Highlight matching delimiters when caret is and set Highlight with option to outline.

Erdogan Kurtur
  • 3,630
  • 21
  • 39
  • Nice @Edokan, sounds like the right thing. I can check tomorrow and accept if it right. – radbyx Nov 21 '13 at 17:09
  • To customize the highlighting colors, you can go to Tools › Options › Environment › Fonts and Colors › Text Editor. If you chose Highlight With Outline, the color is controlled by the `ReSharper Brace Outline` foreground color. Otherwise, if you chose Highlight With Color, the color is controlled by the `ReSharper Matched Brace` background color. – Ben Hutchison Jan 19 '23 at 10:31
1

You can do a rectangular selection by holding the ALT key down while dragging the mouse over a block of text.

AdrianHHH
  • 13,492
  • 16
  • 50
  • 87
  • Okay I didn't knew that, but it's not what I want sorry. I need it to automatically show me the scope where I have my cursor. – radbyx Nov 20 '13 at 16:19
1

May be it was the DevExpress CodeRush plugin you had seen previously, I have not used it myself but this question may help.

Community
  • 1
  • 1
Piers Myers
  • 10,611
  • 6
  • 46
  • 61