| Author |
Message |
|
|
Posted: Dec 04, 2011 - 09:01 AM |
|

Joined: Oct 27, 2004
Posts: 131
|
|
A "feature" in AS5 is slowly making me go insane. It won't let me put a left brace '{' where I want it to go. It insists on putting it somewhere else.
To reproduce, create a new C file and type in this:
Code:
{
{123},
};
Then place your cursor at the end of the '{123},' and try to put in a left brace ...
On my system the cursor jumps to the beginning of the line and inserts the brace *before* the '{123},'. The only way to insert a left brace is to use copy+paste. |
|
|
| |
|
|
|
|
|
Posted: Dec 04, 2011 - 09:05 AM |
|


Joined: Mar 27, 2002
Posts: 18751
Location: Lund, Sweden
|
|
Modern IDEs often "help" you with braces etc, following some "standard". If the IDE is not crap, then you should be able to control how, or even if, the IDE does this.
I'll have a look in AS5. Just need to start it first, and it is now about 10 AM local time (09:04 GMT). Expect an answer some time this afternoon (i.e after 11:04 GMT, or in just a few hours).
EDIT: I've been around all the places in Tools, Options that could reasonably be about this. Seems they've hid it really well. I'm stumped... |
|
|
| |
|
|
|
|
|
Posted: Dec 04, 2011 - 09:18 AM |
|

Joined: Oct 27, 2004
Posts: 131
|
|
Thanks!
I'm used to IDEs moving things around, but it's always contiguous.
I've had a look in Options and the VAssistX menus, and I can't see anything obvious.
VAssistX has an option in "VAssistX->Advanced->Corrections" for: Insert () and closing })]'" but even if I disable VAssistX, it still does this weirdness. |
|
|
| |
|
|
|
|
|
Posted: Dec 04, 2011 - 09:49 AM |
|


Joined: Mar 27, 2002
Posts: 18751
Location: Lund, Sweden
|
|
| Ah, VAssistX! Forgot about that. Looked through that too, and could not see anything obvious. I dabbled around a while with the "VA Snippets" (there is one for "{...}" ) but came out with nothing. |
|
|
| |
|
|
|
|
|
Posted: Dec 04, 2011 - 10:57 AM |
|


Joined: Jul 18, 2005
Posts: 62935
Location: (using avr-gcc in) Finchingfield, Essex, England
|
|
There is definitely an option to control this as I stumbled across it the other day. That's what I love about IDEs - you can spend a good half hour scanning through menus trying to find the "obvious" place they've hidden an option you are looking for.
EDIT: could this be it? Set to "Smart" by default... |
_________________
Last edited by clawson on Dec 04, 2011 - 11:02 AM; edited 1 time in total
|
| |
|
|
|
|
|
Posted: Dec 04, 2011 - 11:00 AM |
|


Joined: Mar 27, 2002
Posts: 18751
Location: Lund, Sweden
|
|
|
Quote:
There is definitely an option to control this as I stumbled across it the other day.
And...?
[see my edit/picture above] |
|
|
| |
|
|
|
|
|
Posted: Dec 04, 2011 - 11:49 AM |
|

Joined: May 03, 2004
Posts: 224
Location: Cologne, Germany
|
|
| I cannot prevent this behaviour either. I disabled VissualAssistX, set Indenting from "Smart" to "None" and tried a lot of other switches in the "Text Editor->General" dialog settings, but no luck. |
|
|
| |
|
|
|
|
|
Posted: Dec 04, 2011 - 12:59 PM |
|


Joined: Mar 27, 2002
Posts: 18751
Location: Lund, Sweden
|
|
|
Quote:
EDIT: could this be it? Set to "Smart" by default...
Nope. Tested. Still same behaviour. |
|
|
| |
|
|
|
|
|
Posted: Dec 05, 2011 - 10:09 AM |
|


Joined: Jan 23, 2004
Posts: 9878
Location: Trondheim, Norway
|
|
Looking at my installation of (the full) Visual Studio 2010, it seems there are additional "Formatting" options that are missing in the AS5 shell, including one for automatic brace management. Going through the registry reveals these are located in a special "LanguageServices" node, which is missing in the corresponding AS5 Visual Shell options node. You might be able to manually create the option entry in the registry, although since the entire LanguageServices node is missing I doubt the AS5 shell would respect the setting.
- Dean  |
_________________ Atmel Studio 6.1 is now released, grab it here.
Report AS6/ASF bugs here.
|
| |
|
|
|
|
|
Posted: Dec 05, 2011 - 10:27 AM |
|


Joined: Mar 27, 2002
Posts: 18751
Location: Lund, Sweden
|
|
Thank you for that Dean! AS I understand "language services" they are "modules" that are "plugged in" into the Visual Studio "framework". What I am having trouble with here is that (as I understand it) Atmel has provided a language service for C/C++, and that service seems to be using a setting belonging to another language service (something from Microsoft).
My abundant use of quotes above reveals that my knowledge in this field is superficial or worse. And since I'm home with the flu I am not near a VS2010 (full) machine to have a look at the details of the registry. |
|
|
| |
|
|
|
|
|
Posted: Feb 22, 2012 - 04:02 PM |
|

Joined: Dec 22, 2003
Posts: 8
|
|
| Now that that issue is settled, is there a shortcut key in the editor that will take you from one brace to the opposite match? |
|
|
| |
|
|
|
|
|
Posted: Feb 22, 2012 - 04:14 PM |
|


Joined: Mar 27, 2002
Posts: 18751
Location: Lund, Sweden
|
|
I'm not at an AS5-enabled machine right now but Visual Studio has had this for many versions, so try ctrl-[ in AS5 and see if it made it over..
For a non US keyboard that is
ctrl-whateverKeyThatIsToTheRightOfP |
|
|
| |
|
|
|
|
|
Posted: Feb 22, 2012 - 04:23 PM |
|


Joined: Jul 18, 2005
Posts: 62935
Location: (using avr-gcc in) Finchingfield, Essex, England
|
|
(I never cease to be amazed how long AS5 takes to actually do anything - I even had it open but just asked it to load a solution - two minutes later it completed)
ANyway I confirm that Ctrl-] (not Ctrl-[) toggles to the matching brace. What's more, if you sit the cursor to the right of either brace both the opening and closing are highlighted in grey |
_________________
|
| |
|
|
|
|
|