Visual Studio 2015-空行上的任意光标位置 [英] Visual Studio 2015 - arbitrary cursor position on empty line

查看:236
本文介绍了Visual Studio 2015-空行上的任意光标位置的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

初始注释:我没有收到超级用户对我的

Initial note: I'm not getting any responses over on superuser to my question, so please allow me to ask this here:

我继承了具有许多非正统设置的VS解决方案.我不能随意删除所有这些设置并重新开始.所以有1个设置我想改回VS默认值但找不到.

I inherited a VS solution with a bunch of unorthodox settings. I'm not at liberty to wipe out all those settings and start over. So there is 1 setting I want to change back to VS default but cannot find it.

在正常/默认VS c#环境中,当您在尚未编写的代码行(空,无空格,无代码,无制表符)上单击鼠标时,光标会自动定位到以下代码的开头代码行应该从哪里开始.如果它只是位于foreach,if或其他内容中,则会根据制表符规则等从左边缘缩进一点.

In a normal/default VS c# environment, when you click the mouse on a line of code that hasn't been written yet (empty, no spaces, no code, no tabs), the cursor automatically positions to the beginning of where the line of code should begin. If it's just inside a foreach, if, or etc, it will indent a bit from the left edge according to tab rules, etc.

但是在VS怪异的设置中,无论我单击何处,光标都位于该确切位置.因此,如果单击下一行的第20列,光标将停留在第20列,而不是自动重新定位到第5列或应位于的位置.这太烦人了,因为我无法始终盯着光标应位于的位置,而我最终单击了上一行的末尾,然后按Enter,这时它将转到下一行并将光标定位在正确的位置

But in the weird VS settings I have, wherever I click, the cursor positions at that exact spot. So if I click on col 20 of the next line, the cursor remains at col 20 rather than auto-repositioning to col 5 or wherever it should be. This is SO annoying because I can't always eyeball where the cursor should be and I end up clicking at the end of the previous line, then hitting ENTER, at which time it goes to the next line and positions the cursor at the right place.

我该如何解决?

推荐答案

它由启用虚拟空间选项控制.请参见Visual Studio选项-文本编辑器-C#.默认情况下,它处于关闭/未选中状态.

It is controlled by the Enable virtual space option. See Visual Studio options - Text Editor - C#. By default it is off/unchecked.

这篇关于Visual Studio 2015-空行上的任意光标位置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆