可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
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 chars but displays them as spaces? Is there a setting to fix this?
回答1:
Yes it does. The way to enable this depends on your version of Notepad++. On newer versions you can use:
View->Show Symbol->Show All Characters
or
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:
View->Show all characters
or
View->Show White Space and TAB
回答2:
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
回答3:
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/