5

When I try to use the shortcut for moving lines up/down (Ctrl+Alt+Shift+/), it highlights the code and shows the tooltip message "Use Up/Down to move text line" but nothing happens. If however I try the same command via the menu bar (Resharper > Edit > Rearrange Code > Move Up) it moves the selected lines as expected.

I used to use this feature all the time so I find this bug very annoying. Apparantly, others also experience this (see comments for Resharper move line up down not working) but I haven't been able to find a solution for it. Resetting keyboard layouts and reapplying VS keyboard schemes doesn't work.

Has anyone been able to resolve this issue?

Community
  • 1
  • 1
flitig
  • 531
  • 2
  • 11
  • 1
    After troubleshooting this issue a bit more I'm no longer sure this is an issue with Resharper or Visual Studio but rather an issue with Windows (7) and keyboard layouts. It turns out that pressing AltGr+Shift+Up works (with Swedish keyboard layout). Using the field to assign keyboard shortcuts under Tools > Options > Environment > Keyboard in VS and pressing the above combination yields Ctrl+Alt+Shift+Up. Also, clicking the combination Ctrl+Alt+Shift+Up on the On Screen Keyboard works, but pressing the keys will only highlight the Ctrl, Alt and Shift key on the On Screen Keyboard. – flitig Aug 03 '16 at 09:32
  • I have exactly the same issue but with VS2012. However, I'm not able to do any keyboard shortcuts as an alternative. The code is highlighted like you said but the arrow keys seems to do absolutely nothing. And what I hate the most is that no option is available to deactivate this feature. I use a lot of shortcut with Ctrl+Alt+Shift and each time that I press these keys more than 1 second, the code is highlighted which is prevent me to read clearly the code. – Samuel Sep 03 '16 at 02:37

1 Answers1

4

[EDIT]

Reason of this is issue (when you are logging to machine with VS and Resharper via Remote Desktop) is that Ctrl-Alt-Left Arrow/Ctrl-Alt-Right Arrow combinations are not sent to your virtual machine

There are two workarounds:

  1. My first soultion (change combination see below)

  2. You can use AutoHotKey script as stated in thread: https://superuser.com/questions/327866/remote-desktop-sending-ctrl-alt-left-arrow-ctrl-alt-right-arrow-to-the-remote-p

[/EDIT]

Reason is duplication of the same hotkeys which could be found in 'Shortcut currently used by:' combobox

Fix is

I described process for _MoveRight shortcut - for other shortcuts it works the same

STEP 1 Check for conflicting changes

seeImage

  • go to Tool --> Options --> Keyboard

  • in field 'Show commands containing' find your command (moveright in example)

  • click in field 'Press shortcut keys' press ALT + RIGHT ARROW

  • in field Shortcut currently used by you will find conflicting shortcut - Edit.CompleteWord...

STEP 2 Now we need to delete this shortcut

  • in field 'Show commands containing' write Edit.CompleteWord

  • you should see ALT + RIGHT ARROW shortcut in field 'Shortcuts for selected command

  • click Remove button

STEP 3 Now we need to add our shortcut to _MoveRight function

  • in field 'Show commands containing' find your command (moveright in example)

  • click in field 'Press shortcut keys' press ALT + RIGHT ARROW

  • click Assign

Reven
  • 776
  • 2
  • 8
  • 23
  • This doesn't solve my issue, I don't want to reassign the command to a new key combination. There's no conflict for the commands Move up/Move down. If you read my comment to the question you'll see that no keys get assigned if I try pressing Ctrl + Alt + Shift + Up. However, if I press AltGr + Shift +Up then Ctrl + Alt + Shift + Up gets assigned. As I stated, I don't think this is an issue with Visual Studio or Resharper, it's most likely an issue with regional keyboard layout settings. – flitig Jun 28 '17 at 15:47
  • I agree with you, I didn't tested reassigning/using original Ctrl + Alt + Shift + Up combination, however if you need feature of moving blocks of code which resharper offer, you could use my solution. Let me check tomorrow, what can I do about original combination and i will come back to you. – Reven Jun 28 '17 at 22:10
  • @flitig are you connecting to that machine where VS is installed via Remote Desktop/is it virtual machine? – Reven Jun 29 '17 at 18:15
  • Yes, I'm connecting to a physical machine via RDP. You think that might be the issue? – flitig Jun 30 '17 at 09:32
  • @flitig Yes, please see my edit in post. I am also connecting via rdp. – Reven Jul 03 '17 at 13:16
  • Thank you for explaining the issue! I'm marking this question as answered. – flitig Jul 04 '17 at 12:33
  • I am glad that I could help! – Reven Jul 04 '17 at 15:01