记事本吗++ 显示所有隐藏字符?

发布于 2024-07-18 01:58:51 字数 303 浏览 5 评论 0原文

在 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(7

青春如此纠结 2024-07-25 01:58:51

是的,它确实。 启用此功能的方法取决于您的 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 ViewShow Symbol → *Show All Characters`

or

Menu ViewShow SymbolShow 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 ViewShow all characters

or

Menu ViewShow White Space and TAB

空心↖ 2024-07-25 01:58:51

在较新版本的 Notepad++(当前为 5.9)中,此选项位于:

View->Show Symbol->Show All Characters

View->Show Symbol->Show White Space and Tab

In newer versions of Notepad++ (currently 5.9), this option is under:

View->Show Symbol->Show All Characters

or

View->Show Symbol->Show White Space and Tab
面犯桃花 2024-07-25 01:58:51

使用十六进制编辑器插件仔细检查您的文本。 在您的情况下,可能有一些控制字符已渗入您的文本中。 通常你会查看空白,它会显示 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/

夏至、离别 2024-07-25 01:58:51

不,不是的。 至少在没有插件的情况下是原生的。

是的,N++ 确实显示了几乎所有不可打印的字符,但不是全部,即使打开了“显示所有字符”选项。

例如,即使打开“显示所有字符”,也不会显示 U+200BU+FEFFU+A0


我们来看看这个来自在线工具的示例:
在线工具确实显示所有字符


这是 N++ 中的样子:

Notepadd++ 不显示所有字符


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 or U+FEFF or U+A0 are not displayed, even when toggling ON "Show all char".


Let's take this sample, from an online tool:
An online tool that DOES display all char


Here is what it looks like in N++:

Notepadd++ does NOT display all char


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++".

后来的我们 2024-07-25 01:58:51

对于非打印字符,您可以执行以下操作:

  • 如果您可以识别该字符,其中光标需要 2 个方向键
    要移动,只需选择该角色即可。
  • 执行 Ctrl-F
  • 现在您可以计数或
    替换甚至标记所有此类字符

For non-printing characters, you can do the following:

  • if you could identify the character, where cursor takes 2 arrow keys
    to move, just select that character.
  • do Ctrl-F
  • now you can count or
    replace or even mark all such characters
ゞ记忆︶ㄣ 2024-07-25 01:58:51

是的,不幸的是您无法关闭它们或任何其他特殊字符。 \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.

戒ㄋ 2024-07-25 01:58:51

在 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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文