Introduction
Notepad ++ uses Scintilla for the editor component. Scintilla has a function SCI_SETCONTROLCHARSYMBOL(int symbol) where you can set the character that will be used for control characters. From the Scintilla docs, they describe the functionality:
SCI_SETCONTROLCHARSYMBOL (int character)
SCI_GETCONTROLCHARSYMBOL
By default, Scintilla displays control characters (characters with codes less than 32) in a rounded rectangle in the form of ASCII mnemonics: "NUL", "SOH", "STX", "ETX", "EOT", "ENQ", "ACK", " BEL "," BS "," HT "," LF "," VT "," FF "," CR "," SO "," SI "," DLE "," DC1 "," DC2 "," DC3 " , "DC4", "NAK", "SYN", "ETB", "CAN", "EM", "SUB", "ESC", "FS", "GS", "RS", "US", These Mnemonics occur from the first days of signal transmission, although some are still used (for example, LF = line feed, BS = inverse interval, CR = carriage return).
You can replace these mnemonics with the assigned character with an ASCII code in the range of 32 to 255. If you set the character value to less than 32, all control characters will be displayed as mnemonics. The character you specify is displayed in the font of the style set for the character. You can read the current character using the SCI_GETCONTROLCHARSYMBOL message. The default character value is 0.
There is probably a βrightβ way to do this, but I'm going to give you a very hacky way to do it.
Equipment
Edit the %APPDATA%\Notepad++\shortcuts.xml file using anything EXCEPT Notepad ++.
Add the following to the <Macros> section of the file to manually add the macro:
<Macro name="RemoveControl" Ctrl="no" Alt="no" Shift="no" Key="0"> <Action type="0" message="2388" wParam="32" lParam="0" sParam="" /> </Macro>
Note that you can set a shortcut using the Ctrl , Alt , Shift and Key attributes. wParam set the character to be used instead of the prescribed codes. In this case, code 32 is a space in the ASCII standard. Message 2388 is a constant for the value SCI_SETCONTROLCHARSYMBOL .
Save file
using
Now you can change the behavior of Notepad ++ at runtime. To use this, do the following
Open Notepad ++ Just open the editor. If you open the file directly (i.e., edit using the Notepad ++ context menu), you will get strange behavior.
Activate the macro from the menu (or your shortcut). If there is a way to automate the macro launch at startup, it would be nice to add it here
Open your file. Nothing new here
Notes
- Positions with a control character will still be inverted (by default, white text on a black background).
- If you activate a macro while the document is open, it will not take effect immediately. You will have to do something to make the window redraw.
- Viewing the Scintilla.h file may open other options that could be used in a similar way.