在 Xcode 中导致问题的不间断空间 [英] No-break space causing problems in Xcode
问题描述
当我在 Xcode 中编写代码时,我经常在方括号或花括号之前或之后输入不间断空格(Option + Space/Option + Shift + Space).这会导致 Xcode 发出警告:
Quite often when I code in Xcode, I type no-break space (Option + Space / Option + Shift + Space) especially before or after square brackets or curly braces. This causes Xcode to give warning:
invalid character in source file
有什么办法可以防止这种行为,因为它真的很烦人而且很少需要?我试图在 Xcode 菜单和 Google 中寻找答案,但没有找到合适的答案.
Is there any way to prevent this behavior, as it is really annoying and rarely necessary? I tried to look for an answer in Xcode menus and Google but didn't find anything proper.
推荐答案
我也遇到了这个问题 (xCode 7.2) 并通过将 Option+Space 和 Option+Shift+Space 分配给使文本书写方向从左到右"找到了解决方法在 Xcode 中
I also had that problem (xCode 7.2) and found a workaround by assigning Option+Space and Option+Shift+Space to "Make Text Writing Direction Left ToRight" in Xcode
- 首选项(菜单)
- 键绑定(部分)
- 默认(下拉)
- 文本(标签)
- 写作方向(部分)
- 使文字书写方向从左到右(命令)
- 双击并使用右侧的 (+) 添加键绑定.
您可以将它们分配给对您没有用的任何其他命令.
You could assign them to any other command that doesn't have a useful effect for you.
当您不小心按住修饰键时,它会让人觉得空格键没有响应,但这比编译错误浪费的时间要少得多.
It will make it seem that the space bar is not responding when you accidentally hold the modifier keys but that's much less of a time waster than the compilation errors.
这篇关于在 Xcode 中导致问题的不间断空间的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!