Rearrange Code shortcut in Resharper doesn't w

2019-04-09 13:52发布

问题:

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?

回答1:

[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