I am debugging/monitoring a log file containing extensively the control character [SOH]
This makes logs barely unreadable (well, to me, on NP++, but it has to be this way as this character is of some use in the protocol I am monitoring)
How do I display that character in a more friendly fashion on NP++ ?
EDIT : Replacement is not an option as I just want to tail the file, not edit it.
Introduction
Notepad++ is using Scintilla for the editor component. Scintilla has a function
SCI_SETCONTROLCHARSYMBOL(int symbol)where you can set the character that will be used for the control characters. From the Scintilla Docs they describe the functionality:There’s probably a "right" way to do this, but I’m going to give you a very hack-y way of accomplishing this.
Technique
Edit the file
%APPDATA%\Notepad++\shortcuts.xmlusing anything EXCEPT Notepad++.Add the following to the
<Macros>section of the file to manually add a macro:Note that you can set a shortcut with the
Ctrl,Alt,ShiftandKeyattributes. ThewParamwill set the character which will be used instead of the spelled-out codes. In this case, code32is a Space in the ASCII standard. Message2388is the constant for theSCI_SETCONTROLCHARSYMBOLvalue.Save the file
Use
Now you can change the behavior of Notepad++ at runtime. To use this do the following
Open Notepad++
Simply open the editor. If you open a file directly (ie. Edit with Notepad++ context menu) you will get weird behavior.
Activate the macro from the menu (or your shortcut).
If there’s a way to automate running a macro on startup it would be nice to add it here
Open your file.
Nothing new here
Notes