在 Visual Studio Code git diff 视图中忽略空格

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/40779222/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-19 12:27:25  来源:igfitidea点击:

Ignore whitespace in Visual Studio Code git diff view

gitvisual-studio-code

提问by maverick

Is it possible to ignore white-space when viewing code differences of a file (generated by GIT) in Visual Studio Code? That will be really helpful in checking for actual code additions/deletions before committing.

在 Visual Studio Code 中查看文件(由 GIT 生成)的代码差异时是否可以忽略空格?这对于在提交之前检查实际的代码添加/删除非常有帮助。

采纳答案by JerryGoyal

I believe OP is asking to ignore all whitespaces (including between words) not just trailing whitespaces.
Unfortunately, it's still not implemented and you can track the process status here: https://github.com/Microsoft/vscode/issues/43026

我相信 OP 要求忽略所有空格(包括单词之间),而不仅仅是尾随空格。
不幸的是,它仍未实现,您可以在此处跟踪进程状态:https: //github.com/Microsoft/vscode/issues/43026

回答by PaoloC

Is a new feature now. Add on your setting.json:

现在是新功能。添加您的setting.json

"diffEditor.ignoreTrimWhitespace": true,