Whole Tomato Software Forums
Whole Tomato Software Forums
Main Site | Profile | Register | Active Topics | Members | Search | FAQ
User name:
Password:
Save Password
Forgot your password?

 All Forums
 Visual Assist
 Feature Requests
 Improvement of {} completion
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

znakeeye
Tomato Guru

379 Posts

Posted - Feb 09 2009 :  10:46:27 AM  Show Profile  Reply with Quote
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  Show Profile  Reply with Quote
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?
Go to Top of Page

znakeeye
Tomato Guru

379 Posts

Posted - Feb 10 2009 :  06:42:35 AM  Show Profile  Reply with Quote
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.
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
19004 Posts

Posted - Feb 10 2009 :  09:17:17 AM  Show Profile  Reply with Quote
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
Go to Top of Page

znakeeye
Tomato Guru

379 Posts

Posted - Feb 10 2009 :  09:37:37 AM  Show Profile  Reply with Quote
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!
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
19004 Posts

Posted - Feb 12 2009 :  10:09:23 AM  Show Profile  Reply with Quote
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
Go to Top of Page

znakeeye
Tomato Guru

379 Posts

Posted - Feb 13 2009 :  09:47:46 AM  Show Profile  Reply with Quote
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, '}'

...
Go to Top of Page

accord
Whole Tomato Software

United Kingdom
3287 Posts

Posted - Feb 13 2009 :  4:55:15 PM  Show Profile  Reply with Quote
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
Go to Top of Page

znakeeye
Tomato Guru

379 Posts

Posted - Feb 20 2009 :  09:09:41 AM  Show Profile  Reply with Quote
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.
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
© 2023 Whole Tomato Software, LLC Go To Top Of Page
Snitz Forums 2000