Author |
Topic  |
|
znakeeye
Tomato Guru
    
379 Posts |
Posted - Feb 09 2009 : 10:46:27 AM
|
I type the following:void foo()
{ and get:void foo()
{
|
} Now I press Ctrl+Z. And the added '}' is removed.
At that point, in 9 out of 10 cases, I want the code below to be part of foo(). Hence, the best thing to do here would be to indent the code below foo(){. |
|
accord
Whole Tomato Software
    
United Kingdom
3287 Posts |
Posted - Feb 09 2009 : 6:23:04 PM
|
void foo()
{
|
}
after I press undo I get
void foo() {|
so I press enter and get
void foo()
{
|
Is this different from what you see? |
 |
|
znakeeye
Tomato Guru
    
379 Posts |
Posted - Feb 10 2009 : 06:42:35 AM
|
No, it's not different. It works as it should.
What I described is a possible feature where the text below is indented to match the foo()-scope. |
 |
|
feline
Whole Tomato Software
    
United Kingdom
19105 Posts |
Posted - Feb 10 2009 : 09:17:17 AM
|
So what do you expect to happen with the code:
void foo()
{
|
}
void bar()
{
}
suddenly bar is going to be indented so that it should become part of foo?
Code formatting, sounds so simple until you try to do it 
If you want to indent the code why don't you just select it and press { to both indent it and wrap it in curly brackets? |
zen is the art of being at one with the two'ness |
 |
|
znakeeye
Tomato Guru
    
379 Posts |
Posted - Feb 10 2009 : 09:37:37 AM
|
Be creative!
I suggested this before. When the '}' is inserted, you show a small indicator that tells the user that VK_DOWN moves the '}' downwards (and VK_UP upwards). Something like a square around the '}' with arrows.
foo()
{
|
[}] <--- indicator around the '}'!
bar(); Pressing <down> (or some other smart shortcut) would yield this:foo()
{
|
bar();
[}] You could then repeat this until you're satisfied with the code block! |
 |
|
feline
Whole Tomato Software
    
United Kingdom
19105 Posts |
Posted - Feb 12 2009 : 10:09:23 AM
|
If you want to do this with the keyboard then why not just use Shift + Down arrow followed by Tab? |
zen is the art of being at one with the two'ness |
 |
|
znakeeye
Tomato Guru
    
379 Posts |
Posted - Feb 13 2009 : 09:47:46 AM
|
Seriously, read my post. It's an idea. A feature you don't have.
Today you'd have to Ctrl+X the '}' and move down and Ctr+V it. Or: Ctrl+Z, enter, del, down, down, down, '}'
... |
 |
|
accord
Whole Tomato Software
    
United Kingdom
3287 Posts |
Posted - Feb 13 2009 : 4:55:15 PM
|
We have an interesting feature that maybe you will like:
Instead of typing
void foo() {
type only the function header:
void foo() |
(| represents the caret) After that select the code line(s) below by ctrl+down, then press the { key. Let's see how it works:
We have this before you press '{':
void foo() |bar();
but if you select the second line by ctrl+down, and then you press '{', you will get:
void foo()
{
bar();
}
Note that you get the right indent automatically. |
Edited by - accord on Feb 13 2009 5:05:40 PM |
 |
|
znakeeye
Tomato Guru
    
379 Posts |
Posted - Feb 20 2009 : 09:09:41 AM
|
I know about this, and I have to admit it's one of the features I turn off as soon as VAX is installed. Even if I liked this feature, it would still mean a lot of work to get what I want here.
Anyway, the idea has been presented. Thanks for the tip. |
 |
|
|
Topic  |
|