Disable adding matching square brackets in JetBrains AppCode
Asked Answered
L

1

7

How do I disable adding a matching open square bracket '[' character when typing a close square bracket ']'?

I've tried various combinations of the Smart Key options, and none of them do what I want. I am able to disable automatically adding a closing bracket ']' when I type an open bracket '[', but not the other way around.

Example:

I have the following line:

if ([myObject respondsToSelector:@selector(outline)])

and my cursor is between the ')' and ']' characters. When I type ']' this is what I get:

if ([myObject respondsToSelector:[@selector(outline) ]])

I expect that the existing ']' will be overwritten by the one I type, or at least that a new '[' will not be added.

I am using AppCode 1.6.2 and the IdeaVIM plugin.

Thank you!

Leighannleighland answered 8/11, 2012 at 15:52 Comment(5)
could you amplify a bit what you want to happen, or maybe give an example of an editor that does things how you like? It would seem odd for me for typing to overwrite the character after the cursor (unless you're in overwrite mode, which I haven't seen anyone use for years; not even sure if it exists on macs).Dendroid
Appcode itself will do this in other contexts (usually with parens) and Sublime Text 2 will do it also. Basically, when the cursor is between the ) and ] characters I want to be able to type ]) and be at the end of the line.Leighannleighland
Yep, I see. I hadn't ever noticed the behaviour because I always jump over the auto-inserted brackets. Given that AppCode does, as you say, do this in some contexts, I'd call this a bug. You might want to report it with a description of the behaviour you want at youtrack.jetbrains.comDendroid
youtrack.jetbrains.com/issue/OC-4038 looks relevantDendroid
Yep, one of the Jetbrains guys got in touch with me and they plan to have this resolved in the next major update. My post on their forums was added to the discussion liked above. Thanks Cris!Leighannleighland
O
-1

In the XCode preferences under the 'Text Editing' tab there is a 'Automatically balance brackets in Objective-C method calls option'. Uncheck that box.

Outspoken answered 1/8, 2013 at 21:50 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.