简体   繁体   中英

Rearrange Code shortcut in Resharper doesn't work in VS2015

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?

[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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM