I'm new to this... but, everytime I make a for loop (or anything similar), and then get to the point where I want to type my ending bracket, I backspace (so it is aligned with the first bracket), type in the bracket, but it always makes it go to the left.
int main()
{
int f=0;
int array[] = {1,2,3,4,5};
for (int n=0; n<5; n++)
{
f += array[n];
} (LIKE THIS)
cout << f;
return 0;
}
And then I have to hit tab again and mess with it to align properly, which is annoying. Any way to fix this?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Well one way is not to back-tab before entering the closing brace! The editor is trying to 'help' you by doing that for you. Just type the brace and it will out-dent it for you.
If you don't like that behaviour, switch it off in the Tools->Editor options dialog. I suggest switching "auto-indent" on and "smart-tabs" off (the word 'smart' here is laughable, it does not seem to do anything that any normal person would want, and perhaps that is your problem), and "use tabs" to off as well, using hard tabs to indent code is a really bad idea. To be honest, I cannot think why you would not have explored the editor options before asking the question - where is your curiosity!?.
Note that HTML ignores leading space in rendering, so your "(LIKE THIS)" illustration is not very helpful.
Clifford
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I'm new to this... but, everytime I make a for loop (or anything similar), and then get to the point where I want to type my ending bracket, I backspace (so it is aligned with the first bracket), type in the bracket, but it always makes it go to the left.
int main()
{
int f=0;
int array[] = {1,2,3,4,5};
for (int n=0; n<5; n++)
{
f += array[n];
} (LIKE THIS)
cout << f;
return 0;
}
And then I have to hit tab again and mess with it to align properly, which is annoying. Any way to fix this?
Well one way is not to back-tab before entering the closing brace! The editor is trying to 'help' you by doing that for you. Just type the brace and it will out-dent it for you.
If you don't like that behaviour, switch it off in the Tools->Editor options dialog. I suggest switching "auto-indent" on and "smart-tabs" off (the word 'smart' here is laughable, it does not seem to do anything that any normal person would want, and perhaps that is your problem), and "use tabs" to off as well, using hard tabs to indent code is a really bad idea. To be honest, I cannot think why you would not have explored the editor options before asking the question - where is your curiosity!?.
Note that HTML ignores leading space in rendering, so your "(LIKE THIS)" illustration is not very helpful.
Clifford