有没有办法让空白在 Xcode 编辑器中可见?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/873712/
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-09 03:02:05  来源:igfitidea点击:

Is there a way to make whitespace visible in the Xcode editor?

xcodeeditorwhitespace

提问by gregschlom

I want the tabs and spaces to be visible in Xcode. Is this possible? I can't find it under preferences.

我希望选项卡和空格在 Xcode 中可见。这可能吗?我在偏好下找不到它。

采纳答案by Pablo Santa Cruz

In Xcode 6.x and earlier:

在 Xcode 6.x 及更早版本中:

View -> Text -> Show Spaces

查看 -> 文本 -> 显示空间

View -> Text -> Show Control Characters

查看 -> 文本 -> 显示控制字符

回答by gregschlom

Editor -> Show Invisibles in Xcode 4

编辑器 -> 在 Xcode 4 中显示隐形

回答by Duncan C

In Xcode 7 and later, this command has moved to the Editor menu:

在 Xcode 7 及更高版本中,此命令已移至编辑器菜单:

Editor > Show Invisibles

编辑器 > 显示隐形

or

或者

Editor > Hide Invisible

编辑器 > 隐藏不可见

回答by Jason Jarrett

You can also use defaultsto read/write to the Xcode plist

您还可以使用默认值来读/写 Xcodeplist

This is used/tested in Xcode 6.1

这是在 Xcode 中使用/测试的 6.1

GUI

图形用户界面

Editor->Show Invisibles

Editor->Show Invisibles

CLI

命令行界面

Turn it on

打开它

defaults write com.apple.dt.Xcode DVTTextShowInvisibleCharacters 1

Turn it off

把它关掉

defaults write com.apple.dt.Xcode DVTTextShowInvisibleCharacters 0

回答by daB0bby

Since Xcode 11:

由于 Xcode 11

In the menu check/uncheck: Editor -> Invisibles

在菜单中选中/取消选中: Editor -> Invisibles

回答by lukas_o

You can also enter a white space into the search field, this will highlight all white spaces in yellow temporarily. I found this accidentally here, where Marty asked the other way around: What are these yellow spacers in Xcode?

您还可以在搜索字段中输入一个空格,这将暂时以黄色突出显示所有空格。我在这里偶然发现了这个,Marty 反过来问:Xcode 中的这些黄色间隔是什么?