记事本吗++ 显示所有隐藏字符?
在 Notepad++ 中,我设置了“用 2 个空格替换制表符”。
当我用 Python 编码时,我从网上复制粘贴了一些代码,它的缩进看起来正确。 但运行代码会导致缩进错误,我最终通过删除行开头的所有“可见”空格并再次插入相同数量的空格来解决这个问题。
基于 Scintilla 的 Notepad++ 是否可能不显示所有特殊字符,但显示它们作为空格? 有设置可以解决这个问题吗?
In Notepad++ I have set "replace tab with 2 spaces".
When coding in Python I copy-pasted some code from the web and it appeared indented correctly. But running the code resulted in indentation errors, which I solved in the end by removing all "visible" spaces at line beginnings and inserting the same amount of spaces again.
Could it be possible that Scintilla based Notepad++ does not show all special characters, but displays them as spaces? Is there a setting to fix this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(7)
是的,它确实。 启用此功能的方法取决于您的 Notepad++ 版本。 在较新的版本上,您可以使用:
菜单查看→显示符号→*显示所有字符`
或
菜单查看→显示符号 → 显示空白和 TAB
(感谢下面 bers 的评论和 bkaid 对这些更新位置的回答。)
在旧版本上,您可以查找:
菜单 查看 → < em>显示所有字符
或
菜单查看→显示空白和TAB
Yes, it does. The way to enable this depends on your version of Notepad++. On newer versions you can use:
Menu View → Show Symbol → *Show All Characters`
or
Menu View → Show Symbol → Show White Space and TAB
(Thanks to bers' comment and bkaid's answers below for these updated locations.)
On older versions you can look for:
Menu View → Show all characters
or
Menu View → Show White Space and TAB
在较新版本的 Notepad++(当前为 5.9)中,此选项位于:
或
In newer versions of Notepad++ (currently 5.9), this option is under:
or
使用十六进制编辑器插件仔细检查您的文本。 在您的情况下,可能有一些控制字符已渗入您的文本中。 通常你会查看空白,它会显示 32 32 32 32,或者 Unicode 32 00 32 00 32 00 32 00。如果没有大量代码,你可能会以这种方式发现问题。
从这里下载 Hex 插件;
http://sourceforge.net/projects/npp-plugins/files/Hex% 20编辑/
Double check your text with the Hex Editor Plug-in. In your case there may have been some control characters which have crept into your text. Usually you'll look at the white-space, and it will say 32 32 32 32, or for Unicode 32 00 32 00 32 00 32 00. You may find the problem this way, providing there isn't masses of code.
Download the Hex Plugin from here;
http://sourceforge.net/projects/npp-plugins/files/Hex%20Editor/
不,不是的。 至少在没有插件的情况下是原生的。
是的,N++ 确实显示了几乎所有不可打印的字符,但不是全部,即使打开了“显示所有字符”选项。
例如,即使打开“显示所有字符”,也不会显示
U+200B
或U+FEFF
或U+A0
。我们来看看这个来自在线工具的示例:
这是 N++ 中的样子:
NB: Notepad++ 确实“看到”这些字符,因为如果您移动用箭头键移动光标,在第 3 行的每个点之后再按一次键,它不会移动。但即使使用“显示所有字符”选项,它也不会显示它们。
免责声明:这个问题是关于空格的,但标题更广泛,这是搜索“在 N++ 上显示所有字符”时 SERP 上的第一个结果。
No, it does not. At least not natively without plugins.
Yes, N++ does show almost all non printable char, but not all of them, even with the option "Show all characters" toggled on.
For instance,
U+200B
orU+FEFF
orU+A0
are not displayed, even when toggling ON "Show all char".Let's take this sample, from an online tool:
Here is what it looks like in N++:
NB: Notepad++ does "see" those characters, because if you move your cursor with the arrow keys, it will not move for one more keystroke after each dot on line 3. But it doesn't display them, even with "Display all characters" options.
Disclaimer: This question was about spaces, but the title is more broad, and this is the first result on SERPs when searching about "displaying all chars on N++".
对于非打印字符,您可以执行以下操作:
要移动,只需选择该角色即可。
替换甚至标记所有此类字符
For non-printing characters, you can do the following:
to move, just select that character.
replace or even mark all such characters
是的,不幸的是您无法关闭它们或任何其他特殊字符。 \View\Show Symbols 下的选项仅打开或关闭制表符、空格、EOL 等内容。因此,如果您想阅读一些带有文本的晦涩编码 - 您实际上需要寻找其他地方。 我还考虑过更改编码,ASCII 没有列出,无论如何这也不会让混乱变得不可见。
Yes, and unfortunately you cannot turn them off, or any other special characters. The options under \View\Show Symbols only turns on or off things like tabs, spaces, EOL, etc. So if you want to read some obscure coding with text in it - you actually need to look elsewhere. I also looked at changing the coding, ASCII is not listed, and that would not make the mess invisible anyway.
在 Notepad++ v8.4.8(可能还有更早的版本)中,需要使用插件。 使用 Converter 插件(v4.5 作者 Do Ho)的 ASCII 到 HEX 转换器(插件 -> 转换器 -> ASCII 到 HEX)可以显示此类字符并适用于我
In Notepad++ v8.4.8 (and probably earlier versions) a plugin needs to be used. Using the Converter plugin's (v4.5 author Do Ho) ASCII to HEX converter (Plugins -> Converter -> ASCII to HEX) can reveal such characters and worked for me