Show ¤ and ¶ symbol instead of [CR][LF] when whitespaces enabled
When whitespaces are enabled, Notepad++ shows in black inverted text [CR][LF] (with of 4 characters) at the line end. How can I change the line end to show a lightwight paragraph/pilcrow sign (U+00B6) in the way other editors do?
Example Windows file:
and Linux file:
And how can I customize the intensity/colour of the whitespaces since the preset light orange is sometimes hard to see.
I don’t think you can.
Anyway text rendering is performed by Scintilla so you better ask in that forum.
This is supported by Scintilla (http://www.scintilla.org/ScintillaDoc.html#CharacterRepresentations) but needs to be customized like this:
But I do not find such a topic in the settings. The only thing I found is the colour setting for whitespaces in the Style Configurator.
My feeling is that the CR and LF inverted text are indeed too “heavy”. So I leave them turned off. I can always turn them on (temporarily) if I feel I need them for some reason, but this is rare. I just know that they are there. Why clutter your display with something you know is there and doesn’t add value? Okay, maybe if you are doing some crazy stuff where some of your lines (in the same file) have a Windows line-endings and some have Linux, but you don’t indicate that is your use case. I think the symbols you are wanting to see are not exactly “lightweight”, either, but you are entitled to want what you want. And I think @gstavi is right in that you can’t change them.
So on to the part that you can change… If you use or are willing to use the Pythonscript plugin, you can make the horizontal whitespace characters more visible by calling the following function in a script (e.g. startup.py):
You can vary the integer argument to get the visibility you’d like.
There might be a way to do it via the NppExec plugin as well.
Follow-up…how to do it with the NppExec plugin:
Follow the general technique presented here (http://superuser.com/questions/401551/notepad-cursor-past-end-of-line-virtual-spaces), but instead of sending message 2596, send message 2086, like so:
SCI_SENDMSG 2086 2
Again, the “2” just represents one possible size; it’s the one I use as it strikes a balance between the default size (which is just too small for me–looks like little specs of dust on my monitor) and something that is annoyingly large.
I tried NppEcec and sent SCI_SETREPRESENTATION (=2665)
SCI_SENDMSG 2655 “A” “XXX”
which replaced all A’s in the editor by XXX’s (inverted colour like CR LF). But this was only half way. None of
SCI_SENDMSG 2655 “CR” “11”
SCI_SENDMSG 2655 “\x0a” “33”
SCI_SENDMSG 2655 “\r” “55”
did work, even tried other control chars in the range from 0 to 32.
So it is currently not possible to change the shape of control characters.
I think you meant “2665” throughout, not 2655.
I think part of the problem is in the way NppExec handles quoted/escaped characters. I figured PythonScript would be better at escaping strings.
Thus I made the text file:
ABCDEF ohm Ω Omega Ω
(I used the Ohm and Omega, because those were examples at http://www.scintilla.org/ScintillaDoc.html#SCI_SETREPRESENTATION, and I was trying to prove whether or not the functionality worked as described by Scintilla)
When I viewed with showing end-of-line, I get
Using PythonScript’s console to send these one at a time:
editor.setRepresentation("\x41"," x41 ") editor.setRepresentation("\xe2\x84\xa6", " \xe2\x84\xa6 OHM ") editor.setRepresentation("\x0a", "____ big long replacement ___") editor.setRepresentation("\x0d", " medium ")
I then see:
LFare longer than before, but still show
If I change either the
\x0dmapping, the length of the CR or LF bar changes, but it still always says just
LF(though if I use a 1char or 0char map, they are truncated).
Trying other control characters: before changes (with show-all-chars):
editor.setRepresentation("\x00", " 00h ") editor.setRepresentation("\x01", " 01h ") editor.setRepresentation("\x02", " 02h ") editor.setRepresentation("\x03", " 03h ") ... editor.setRepresentation("\x1e", " 1eh ") editor.setRepresentation("\x1f", " 1fh ")
The control characters become:
showing everything but
LFbeing correctly replaced.
My conclusions: NppExec doesn’t handle escaped-characters in a way that I can figure out, and PythonScript handles them as I would expect (in a c-like manner). The message SCI_SETREPRESENTATION does do something to those two characters, but it doesn’t do what you would want – apparently, some special handling occurs for just
PS: TAB didn’t change, either; so there’s a third exception.
In Eclipse this works out of the box:
Thankfully not all of the bad features of Eclipse are found in Notepad++! :-)