What is Visual Studio doing?

Nov 22, 2019 at 9:25pm
closed account (E8A4Nwbp)
Often as I am in thick of a Ctrl+C and Ctrl+V cycle in Visual Studio 2017, inadvertently, I at times initiate some keybind which unwantedly causes the definition place of what I just highlighted to change to the name of what I just pasted. What keybind would initiate such an action?

The question is not trivial. If I am not aware of the trigger, I may at one point inadvertently and unconsciously cause a definition replacement which may subsequently result in an error difficult to locate or tedious to rectify.
Nov 22, 2019 at 11:14pm
I at times initiate some keybind which unwantedly causes the definition place of what I just highlighted to change to the name of what I just pasted.
This sentence is too ambiguous. Give an actual example that triggers the behavior.
1. What did you copy?
2. Where or onto what did you paste it?
3. What did you have selected (that's the actual term) at the time the behavior occurred?
4. What exactly was renamed?
Nov 23, 2019 at 11:14am
closed account (E8A4Nwbp)
1
2
3
4
	
DA = tukhla::create(...);
	DA->setPosition(...));
	DA->setScale(...);


I would do this to the first line

AB = tukhla::create(...);

and then select AB,

ctrl + c

select the next DA

then Ctrl + V

and repeat for the other DA

60% of the time what I described in the initial post occurs, unwantedly

Last edited on Nov 23, 2019 at 11:22am
Nov 23, 2019 at 1:28pm
and repeat for the other DA
Do you mean you repeat the action for line 3? If so, then what's the unexpected behavior?
Nov 23, 2019 at 4:16pm
*SMH* Wow, you really are doing things the hard way. VS 2017 (and 2019) have tools to make changing same blocks of text MUCH easier.

No wonder you keep mucking things up with unnecessary repeated copy'n'pasting.

If you are changing the name of a function or variable you put your pointer over the name you want to change, right click and select Rename. A dialog box pops up where you can change the text. Select Preview and you get to see all the text in context that will be changed.

Hit Apply and all the variable or function names are changed.

Another tool, under the Edit menu, is Find and Replace. I will let you figure that one out.
Last edited on Nov 23, 2019 at 4:18pm
Nov 23, 2019 at 5:54pm
closed account (E8A4Nwbp)
*SMH* WOW YOU REALLY ...
I am perfectly aware of that approach, but such a procedure will not work in this situation for a reason I don't need to explain as it isn't relevant.

Ease is not worth time, I believe.


Do you mean you repeat the action for line 3? If so, then what's the unexpected behavior?
When I press Ctrl+ V, the definition place of DA changes to AB.
tukhla DA
becomes
tukhla AB
I would deduce that I inadvertently entered a key combination
which went to the definition. But what would that key combination be?

Keyboard type:
https://pasteboard.co/II3beKz.png
I use the left side of the keyboard
Last edited on Nov 23, 2019 at 6:02pm
Nov 23, 2019 at 7:14pm
VS 2017 & 2019 allow for keybindings with multiple key combinations. Globally and menu subsystems. VS has quite a lot of preset key combos, I have added ones myself.

CTRL+SHIFT+B, CTRL+SHIFT+B brings up the Batch Build dialog for example. Likely in your haste of doing repeated CTRL+C/CTRL+V operations you are inadvertently activating a multiple key combo bound operation.

I do it all the time, accidentally. Most times it is entering the first part of the chord (CTRL+SHIFT+S for example), without entering the second part of the chord. Another key press for something else is then added to the chord and *BUZZ!* Wrong key combo.

None of the mistyped key combos so far is actually assigned to do something in VS.

Or I mistype the keybindings. Instead of CTRL+V I type CTRL+B

But what would that key combination be?

It is your system, and your fingers, we can't remotely troubleshoot the problems you are having with VS.

Who the hell reported Astra? It wasn't me.
Nov 25, 2019 at 2:05pm
You are hitting CTRL already while clicking on the position you want to paste to. CTRL+Click can be configured to "Go to definition". This is probably activated on your instance.
Nov 25, 2019 at 2:25pm
I'm not sure what is the problem here but you can figure out existing keybindings in VS in:
Tools > Options > environment > keyboard

there you can customize key bindings, and most important, when you do so the IDE will tell you if your new keybinding exists! that may help you trouble shoot where is the problem.

Btw. Is you keyboard in VS slowing down when typing? that may also cause key bindings to not be triggered correctly, and a workaround consists of multiple fixes, let me know if this is true! I had this problems and know the fix.
Nov 27, 2019 at 7:13pm
closed account (E8A4Nwbp)
Thank you very much, @LunarLander that is the solution
Topic archived. No new replies allowed.