News:

As usual while waiting for the next release - don't forget to check the nightly builds in the forum.

Main Menu

How can I get auto close bracket/inverted commas?

Started by gcampton, December 15, 2009, 03:55:45 PM

Previous topic - Next topic

gcampton

Hello,
This is a standard function of most text editors, that code-blocks and another ms product that shall remain unnamed don't seem to come with as standard...

I thought the long awaited jump from text editor(VI) to IDE would be a painful process and hence I put it off for a little over 7months. Anyway, back to the topic, I can't seem to find where to enable this, I tried making a autocompletion (ctrl +J) function called by pressing {{ and ctrl J, this didn't work.

can anyone please shed some light on how I can get automatic closing brackets and/or inverted commas ?

ollydbg

Sorry, I can't fully understand your question.
Did you want to jump from the open brace to close brace?? just use CTRL+SHIFT+B. :D
If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.

Jenna

It would be really helpful to know which version of C::B you use and which os (and version) you use.

gcampton

CB 8.02 windows 7.

on a large number of text editors when you open a new brace '{' bracket '(' '[' an enclosing one is put directly after the cursor. or in case of the curly brace is put 2 lines below and the cursor jumps the to the next line with -> 1 indent. less frequent editors also have this inclusion for inverted commas. so when you type one, a second one(closing comma) is placed directly after the cursor.

eg _ = cursor

// i type {
{
   _     
}

// i type (
int main(_)

// i type [
int [_]

// i type "
string str1="_"

Jenna

You should use a recent nighly build, both features are implement in the meantime.

gcampton

Are you sure?
I just downloaded and installed the Nov (svn 5911) release and it's not working.

Jenna

You have to check "Settings -> Editor... -> General settings -> Indent options -> Brace completion" and it works only for C/C++- and D-sources/headers.

gcampton

thank you, for some reason it was ticked but was just being buggy, when I closed it down and restarted the computer it worked.

Greatwolf

Hi,

I'm looking for the same feature as the OP but I can't seem to find "Brace Completion" checkbox here.



[attachment deleted by admin]

Jenna


Greatwolf


gcampton

This is still kind of buggy, sometimes this doesn't work at all, for instance in non cpp file types.
Sometimes it doesn't work in cpp files either if I'm outside of a class block or something... But then other times it does.

Would love to see auto comment completion as well.  :shock:
/* enter :


/*
* _
*/


and for javadocs, /**

/**
* _
*
* @param argc
* @param argv
* @return
*
**/
int main(int argc,char *argv[])
{
...

blueshake


QuoteThis is still kind of buggy, sometimes this doesn't work at all, for instance in non cpp file types.
it works only for C/C++- and D-sources/headers.
Keep low and hear the sadness of little dog.
I fall in love with a girl,but I don't dare to tell her.What should I do?

Jenna

Quote from: blueshake on December 19, 2009, 01:12:49 AM

QuoteThis is still kind of buggy, sometimes this doesn't work at all, for instance in non cpp file types.
it works only for C/C++- and D-sources/headers.

Exact what I wrote before:
Quote from: jens on December 15, 2009, 05:29:55 PM
You have to check "Settings -> Editor... -> General settings -> Indent options -> Brace completion" and it works only for C/C++- and D-sources/headers.

Please read the posts carefully.

And for the not working brace-completion in c/cpp-files, please post exactly what you do if it happens, so anyone can reproduce it.