[Help] How to have more than 1 vertical column line?
-
Hi. I want to have more than 1 vertical ruler line, one at column 80 and the other one at column 128 and another one at column 255 for example.
But, I can only have 1. Does anyone know how to have more than 1 line? Maybe with a plugin?
-
AFAIK it is not possible currently. This has possibly come up before and IIRC someone said a newer version of Scintilla (the editing component of Notepad++) supports multiple vertical edges, but unfortunately Notepad++ is way behind on keeping even relatively current with Scintilla. I give that a big:
:-(
A possible workaround may be to use one of the “ruler” plugins, which give you a visual reminder (along the top of the editing tab window) of the column numbers–and it does so more “forcefully” than the the simple column indicator that is always visible in the status bar.
A second thing that comes to mind is that perhaps the solution to this problem could be adapted to lightly color the text in columns between C1 and C2, where C1=128 and C2=255 for your specific case.
-
If scintilla can do it, than notepad++ should be doing it too. I never like it when programs do not keep up with the newer versions of the programs that they are based on.
Do you know then, which version of scintilla notepad++ is using right now?
-
@Scott-Sumner said:
A second thing that comes to mind is that perhaps the solution to this problem could be adapted to lightly color the text in columns between C1 and C2, where C1=128 and C2=255 for your specific case.
That doesn’t sound too bad of an idea if it can be done, and if it won’t slow down n++, but ofc I don’t know how to do it.
We can make it like a darker shade of gray. -
Yea, so the effect could look something like this:
The column start and stop would be adjustable, and color is changeable of course…
-
Okay. Can you make it just a little gray from 80 (blinker at 81) to 128 (blinker at 129)
and then… more gray from 128 (blinker at 129) to 255 (blinker at 256)
: )
-
I really like that pythonscript you made for me earlier that shows the line-final whitespace. if we can also add into this script the columns background color AND bracket highlighting color, it would be beast…
the bracket highlighter would override the background column highlighter, and it won’t interfere with the line-final whitespace highlighter because there is a closing bracket.
the line-final whitespace highlighter would override the background highlighter. (it’s a pink-red colour right now, and should remain the same, these things must be deleted where they are seen, it’s just bad practice to leave these line-final whitespace characters anywhere.)
This may even be better than the ruler, because now the background will be highlighted ONLY when the characters actually cross a certain length, instead of the ruler always being visible (annoying).
This whole background highlighting stuff is really good. It could even be like a plugin of its own, with a GUI and color selection options and everything. Letting the user highlight things as they wish…
I of course volunteer to work on this project with coding and its testing,
Find me on Github with the same name, my Discord tag is there too.
We are free and open source programmers, we should help each other…: )
-
So to make this work in a basic way, take the script from the other thread linked to above and make the following changes to create a script that I’ll call
StylizeTextBetween2Columns.py
:- Change all occurrences of the text
EWH
toSTB2C
. This is not strictly necessary but is good practice. The earlier script was calledEolWhitespaceHighlighter.py
(each capital letter is where the EWH comes from) and this new script is called something different. Changing this helps keep the global variables from each separate. - Change the regular expression to search for from
\h+$
to(?<=^.{80}).{40}
or whatever is desired. The 80 means start in column 80 and the 40 means extend the color zone from there 40 columns to the right. - If a color change is desired, in the original code is the text
(255,0,0)
. This is an RGB color tuple that can be changed to whatever you like for the color.
So this doesn’t do TWO ranges of color, but it would not be that hard to implement. You would need an additional “indicator” (this code uses indicator number 10). Likewise, combining the functionality of this with the earlier script, while a bit more involved, is not terribly difficult either. Since you seem to be a programmer, I will leave these enhancements to you.
- Change all occurrences of the text
-
Hi, thanks for your reply. I have deleted my earlier post with the hotkey for EOL characters because I found out how to do it. It is still kind of there though, I can see it but it is grayed out. How long does it take before it is deleted? just curious.
I will be following the instructions you gave me to try to put all these features together, I will let you know if I make progress or run into issues in this post, keep watch :)