2017-12-18 232 views
0

对于一些用户来说,包括我,似乎在Visual Studio 2017年(也许只有企业版)的快捷Alt键 + /不起作用。的Visual Studio 2017年企业 - 将选定行向上/向下快捷键不能正常工作

如果你去Edit -> Advanced -> Move Selected Lines Up/Down你可以看到快捷方式是否存在。

enter image description here

如果我去Tools -> Options... -> Environment -> Keyboard -> Edit.MoveSelectedLinesUp/Edit.MoveSelectedLinesDown和分配Alt键 + /一切看起来从编辑观点不错。但是,当我使用快捷方式时,Visual Studio会在文件中的类和方法之间跳转,而不是移动该行。如果我从菜单中点击Move Selected Lines Up/Down,则功能按预期工作。为什么是这样?

enter image description here

https://developercommunity.visualstudio.com/content/problem/50611/move-line-updown-shortcut-doesnt-work.html

+0

我看到你安装了Resharper。我的赌注是某种键绑定冲突。 – Crowcoder

+0

@Crowcoder我有'ReSharper'设置为Visual Studio键盘方案。根据文档,它不应该从VS功能中窃取任何键盘绑定。 – Ogglas

+0

尝试禁用Resharper并查看它是如何工作的。 – Crowcoder

回答

1

正如@Crowcoder ReSharper评论似乎是罪魁祸首。使用命令按Ctrl ++ Alt键+/作品。然而,通过Tools -> Options... -> ReSharper Ultimate -> Suspend挂起ReSharper,即使重新启动VS并挂起该功能,正常的命令仍然不起作用。看来ReSharper必须被卸载才能使该功能再次运行。

enter image description here