Whole Tomato Software Forums
Whole Tomato Software Forums
Main Site | Profile | Register | Active Topics | Members | Search | FAQ
 All Forums
 Visual Assist
 Feature Requests
 Copy from the line above/below, charwise

You must be registered to post a reply.
Click here to register.

Screensize:
UserName:
Password:
Format: BoldItalicizeUnderlineStrikethrough Align leftCenterAlign right Insert horizontal ruleUpload and insert imageInsert hyperlinkInsert email addressInsert codeInsert quoted textInsert listInsert Emoji
   
Message:

Forum code is on.
Html is off.

 
Check to subscribe to this topic.
   

T O P I C    R E V I E W
EduardBloch Posted - Aug 16 2007 : 06:51:02 AM
Hello,

one of my favorite features in VIM is copying the chars from the line above instead of retyping each char individually, i.e. getting:

CreateSubject("whatever");
Create

after simply pressing Ctrl-Y 5 times in the new line. I wish the same thing would be possible with VAssistX.
5   L A T E S T    R E P L I E S    (Newest First)
feline Posted - Aug 17 2007 : 07:54:37 AM
One final thought, what happens when someone is using a non fixed sized font? Some people do this, it always sounded very odd to me, but in this case how do you define the letter "above" you? The letter in the same column on the line above? Or the letter that is sort of vertically above your current position?
feline Posted - Aug 17 2007 : 07:52:48 AM
For suggestions try turning on:

VA Options -> Advanced -> suggestions -> Include bits of code from surrounding lines

I have often had VA suggest all sorts of things.

For the VIM CTRL-Y command the simplest argument against it is:

static void testFunction()
{
    CreateSubject("whatever");
    if(true == bCondition)
        Cre|
}

Based on my experience there are two basic situations here. Using existing symbols (function names, variables, etc) and defining new symbols. When using existing symbols suggestions normally work very well, and on the rare occasions they don't I just hit CTRL-SPACE and then find the item I want that way.

For defining new symbols I tend to use CTRL-W, CTRL-C, CTRL-V a lot. CTRL-W selects the current word in VS2003, VS2005, which is a very useful keyboard shortcut, and useful when you want to use a slight variation of an existing name, as in sl@sh's example.

Now you can argue that when declaring class members all members are always lined up, so VIM's CTRL-Y will be ideal. I know from previous discussions about code formatting (where lining things up was discussed) that a lot of the time this does not work so well. Nothing like inserting a 30 or 40 character return type to upset the formatting.

I do see the appeal of this idea, I just feel that it is an idea that is quite "limited", since it only helps under very specific conditions.

A final minor point, by default CTRL-Y is mapped to Edit.Redo - it seems that all the basic keyboard shortcuts are all ready mapped by default in the IDE.
EduardBloch Posted - Aug 17 2007 : 05:11:41 AM
What I was after was actually the simple and stupid character copy.
The suggestion box is a great feature but is not really appropriate in this particular case because it requires knowledge about existing members which not always available, i.e. when prototyping something and writting a function call to something that does not exist yet, or when doing some manual code merge where the base class name changed and the code analyzer didn't understand that.

And I see no problem in using some other key binding for that (rather then [RIGHT]) i.e. the mentioned Ctrl-Y.
sl@sh Posted - Aug 17 2007 : 05:01:03 AM
Methinks EduardBloch is more after cases not covered by suggestions, e. g.
setXValue(1);
setYValue(0);

I remember a tool used for MS DOS shells that simply copied single characters from the corresponding position of the last command when you typed [RIGHT] (arrow key) instead of a character. So in the above example you would type "setXValue(1);[RETURN]" and then "[RIGHT][RIGHT][RIGHT]Y[RIGHT][RIGHT][RIGHT][RIGHT][RIGHT][RIGHT]0[RIGHT][RIGHT]" (which is a lot faster than typing the real thing unless you are a professional typer)

The question arises however how and if this behaviour should be transferred to an editor. Obviously, the [RIGHT] arrow key would be a poor choice since normally you are not editing at the end of a file. For that matter, I have a hard time of coming up with a suitable key that could be bound to this purpose that isn't already bound to another default.

Maybe it would be easier to find a suitable key, if you restrict it to another edit mode, say, overwrite? So, if you switch to overwrite mode, then use <some key>, this would result in copying the character from the ilne above at the corresponding position. Still not sure what key to use, but might be easier to decide on one in this case.
feline Posted - Aug 16 2007 : 07:25:15 AM
Interesting, I was not aware of that feature. Personally I went straight to CTRL-P and CTRL-N, or if I was feeling really clever CTRL-X, CTRL-L

In VA we have suggestion listboxes:

http://www.wholetomato.com/products/features/suggestion.asp

In your example, depending on what code you have already typed, you may well see a suggestion for "CreateSubject" after only typing two or three characters. Just accept the suggestion, and you save a lot of typing

© 2023 Whole Tomato Software, LLC Go To Top Of Page
Snitz Forums 2000