views:

266

answers:

2

Hi,

in Visual Studio 2008 it was possible to open a collapsed #region by simply double clicking somewhere behind (to the right) of the #region. Now in VS 2010 you have to double click exactly the #region, double clicking behind it just selects the #region.

I've browsed the options but didn't find anything helpful and neither did google help.

Does anyone know of a way to switch back to the old behavior?

Thanks, Florian

A: 

I don't think you can do it with the mouse anymore. Your best alternative is Ctrl+M, M (that toggles the current outline section).

ktharsis
I'm using that Shortcut too, it's just annoying when I navigate the Code with the mouse.My best bet is that it can be done using an addin, but currently I just don't have time to do some research on this.Also I can't imagine that noone else is annoyed by this, I mean it's much easier to point the cursor on a line anywhere behind the region instead of exactly the regions textblock.Also the region block location and size is affected by the parent scope indentation and the length of the region text, which makes it even harder to point the mouse excactly on the region.
Florian von Spiczak
Also think of method and property blocks. They just have ... as region block which is quite small.Also thinking about it again I think it's not really just about regions but rather about collapsible blocks in general.
Florian von Spiczak
Its actually about double click behavior in whitespace - but I couldn't find anywhere to change it either.
ktharsis
If you see it that way I think it should be virtual space then (whitespace is then indent of tabs/space infront of it I think).Anyway, toggling the collapsible elements using the mouse DOES work, its just restricted to the exact region of the actual block.I think it has to do with the cursor, on doubleclick the cursor is placed directly behind the collapsible block. In VS 2010 there's no check if the block is collapsed, it's just treated as normal text (word select on doubleclick).In VS 2008 they did the check and treated it correctly as region (expand on doubleclick).
Florian von Spiczak
VS 2010 doesn't treat it as "normal" text, the issue is just how/where the mouse events are handled. In VS2008 code, there was a single, large mouse handling body that did a number of actions in order for each action. In VS2010, the mouse handling code is spread out more, and the collapsed adornment works by just handling mouse clicks on the adornment itself. You should file a Connect bug so we can consider fixing it in future versions of VS.
Noah Richards
+1  A: 

In Visual Studio 2010 the editor has been rewritten from scratch. It is quite likely that they just "forgot" to re-implement this functionality, thus causing a regression. If you feel strongly about bringing it back, I'd open a new bug at https://connect.microsoft.com/visualstudio/feedback

Kirill Osenkov
The way it is currently implemented, the adornment itself listens for the mouse events that let it expand. To make the double-click off to the side thing work would require another mouse processor to listen for double-click events on the editor in general (at a high priority) to find ones that are near collapsed regions. It would be possible, of course, just adds a bit more complexity to the whole thing.As Kirill said, please file a Connect bug if it is really important to you. We'll take these bugs/votes into consideration when making fixes for future releases.
Noah Richards
Ok, maybe I'll do that. Thanks for the clarification :)
Florian von Spiczak