Autoformat用空格替换制表符 [英] Autoformat replaces tabs with spaces

查看:124
本文介绍了Autoformat用空格替换制表符的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,


我有C#的Visual Studio Express 2017,我试图在Doxygen的类属性中添加一些内联注释,并在我的声明和我的声明之间评论我希望有标签来正确对齐我的评论。然而,每次
我按下自动形式键Ctrl-K Ctrl-D时,VS会删除这些标签。设置"保持标签"并没有帮助。在"工具/选项/文本编辑器/ C#/标签"下。 VS无论如何都不会保留这些标签。我没有在"C#/代码样式/格式"下找到任何内容。或者。


无论如何都要阻止autoformat更换我的标签?


亲切的问候是
Alex

解决方案

你好Alesander,


1。尝试设置如下,图1和图2



我的测试如下,


<我输入了四个"""之前 使用System.Text;


在使用System.Threading.Tasks之前键入标签;


3。保存文件并在VS中重新打开。


4。当VS重新打开文件时保留选项卡,参见图3


是否有可能选项卡被其他编辑器替换为空格?




谢谢和问候,


E-John



图1



图2



图3







Hello everyone,

I have Visual Studio Express 2017 for C# and I am trying to add some inline comments to my class attributes for Doxygen, and between my declaration and my comment I wish to have tabs to align my comments properly. VS however deletes those tabs every time I hit the autoformat keys Ctrl-K Ctrl-D. It doesn't help to set "Keep tabs" under "Tools/Options/Text Editor/C#/Tabs". VS doesn't keep those tabs anyway. I didn't find anything under "C#/Code Style/Formatting" either.

Is there anyway to prevent autoformat from replacing my tabs?

Kind regards
Alex

解决方案

Hi Alesander,

1. Try to set as follows, Fig.1 and Fig.2

My test is as follows,

I have typed four "" before using System.Text;

type tab before using System.Threading.Tasks;

3. Save the file and reopen in VS.

4. The Tab is kept when file is re-opened by VS, see Fig.3

Is it possible tab is replaced with space by other editor?

Thanks and regards,

E-John

Fig.1

Fig.2

Fig.3




这篇关于Autoformat用空格替换制表符的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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