Patrick Quirk
Patrick Quirk

Reputation: 23757

Copy/Paste line in Visual Studio 2015 seems broken

I frequently use the "copy/paste line" functionality of CTRL+C in Visual Studio (when nothing is selected, it copies the entire line). In past versions, when I pasted the line, it would always be inserted above the line my cursor is on, regardless of where the cursor is on the line.

In Visual Studio 2015, it seems this is broken or at least non-deterministic. See the screen capture below (note that it Visual Studio is in "safe mode", started with devenv.exe /safemode):

Screen capture of copy and paste line being strange

I'm only ever pressing CTRL+C, CTRL+V, but you can see sometimes it inserts the copied line at the cursor and sometimes inserts the copied line above the cursor.

I've tried toggling the only option that looks like it applies, Text Editor, All Languages, Apply Cut or Copy commands to blank lines when there is no selection, but it makes no difference.

Does anyone else see this behavior?

Upvotes: 3

Views: 2036

Answers (3)

G. Chan
G. Chan

Reputation: 1

Issue: copy/paste not working. Cursor in block mode, not line mode.

Solution: uninstalled each extension one at a time. Closed program, and restarted. Kept a list of the uninstalls in a text file, so I can decide what to reinstall later. The extension called "Vim" was causing me the issue.

Running on: VS Code version 1.26.1, Windows 8.1

Upvotes: 0

kushpaw
kushpaw

Reputation: 1

It is not broken. But the keys are mismatched. Ctrl+C is assigned to File.CloseAllButThis option. Go to Tools => Options => Environment => keyboard. Find command for File.CloseAllButThis, remove currently assigned key ( should have Ctrl + C), and assign it some other combination such as Alt+C. Find Edit.Copy command and assign it Ctrl + C. You should have copy paste working fine.

Upvotes: 0

Patrick Quirk
Patrick Quirk

Reputation: 23757

I found a possible solution/reason for this issue today. This behavior is much more prevalent when I have a TightVNC connection window open, and after a few hours of testing, I have yet to see this problem when no VNC session is open.

This application monitors the clipboard as well as the mouse and keyboard, so it's possible that something it is doing interferes with this functionality of Visual Studio.

Upvotes: 3

Related Questions