[New Plugin] ExtSettings
-
@dinkumoil said in [New Plugin] ExtSettings:
As you can see it is only possible to set the character color and the background color of selected text. No fancy boxes with filling and borders, sorry.
No problem. Thank you for investigating.
You mentioned the “character color”, but Notepad++ ignores the fgColor value for “Current line background colour”, so as far as I understand, it is only possible to modify bgColor of selected text. Your plugin, in addition, allows to modify the transparency, which is then applied to both the background and the text.
Is this correct?
-
@tomasz1986 said:
as I understand, it is only possible to modify bgColor of selected text
That’s true, technically it is possible to set a background and a character color but Notepad++ doesn’t support the latter one.
Notepad++ ignores the fgColor value for “Current line background colour”
Why do you think so? Style configurator provides an option to configure that setting.
Your plugin … allows to modify the transparency, which is then applied to both the background and the text.
No. The alpha value for selections which my plugin can set only changes the opacity of the background color, i.e. the selection color.
-
a new scintilla feature is showing dots next to a folded line
Maybe worth including to your plugin? -
@dinkumoil said in [New Plugin] ExtSettings:
@tomasz1986 said:
as I understand, it is only possible to modify bgColor of selected text
That’s true, technically it is possible to set a background and a character color but Notepad++ doesn’t support the latter one.
Notepad++ ignores the fgColor value for “Current line background colour”
Why do you think so? Style configurator provides an option to configure that setting.
Are these two sentences not contradicting? The setting is indeed there, but the selected text colour does not change, no matter what colour is specified there. Only the background colour changes.
On the topic: https://community.notepad-plus-plus.org/topic/12578/can-t-change-foreground-color-of-selected-text
I hope that we are talking about the same thing here. I use “fgColor” to mean the text/font colour, and “bgColor” to mean the background colour, as this is how they are used in the themes xml files.
-
On the other hand, enforcing the text colour with external scripts (as explained in the other thread linked above) overwrites all syntax highlighting in the selected field of text, so it can become problematic very quickly, and I am not really sure if this is really worth it. That is why I myself would prefer a box style selection :). Since you said that it was not possible, it is probably better to leave the issue as it is, and focus on more important things. I have managed to get the job done with the standard text selection fine enough.
-
@Ekopalypse said in [New Plugin] ExtSettings:
Maybe worth including to your plugin?
Indeed, I think it is. I will put it on my list.
-
@tomasz1986 said in [New Plugin] ExtSettings:
Are these two sentences not contradicting?
I hope that we are talking about the same thing here. I use “fgColor” to mean the text/font colour, and “bgColor” to mean the background colour
Sorry, I’ve messed up things. To be clear I should thoroughly define what I’m talking about.
Selection highlighting
Technically it is possible to set a background and a character color for selection highlighting but Notepad++ doesn’t support the latter one, respectively it ignores the according setting that may be available in whatever config file.
Current line highlighting
As in Style Configurator the setting is named “Current line background colour”, it is only possible to configure the background color of the current line highlighting. Notepad++ doesn’t support configuring the character color, respectively it ignores the according setting that may be available in whatever config file. I don’t know if there is a Scintilla setting that would allow to set the character color of the current highlighted line. I don’t know as well how current line highlighting is implemented internally. Maybe @Ekopalypse can provide this information?
enforcing the text colour with external scripts … overwrites all syntax highlighting in the selected field of text
Yes, thats the reason why I’ve never thought about changing text colors of selection or current line highlighting and would never include such a feature in my plugin.
-
one possible alternative would be to disable that behavior at all
and using indicators with a scripting language plugin like
this. Note, code is just a demo - I haven’t really looked deeper to see
whether there is something else to do. -
sorry but to be honest, I am lost about your discussion with selection and highlighting. If we talk about the selecting lines then the scintilla functions
SCI_SETSELFORE(bool useSetting, colour fore) (this is fgColor which isn’t used by npp)
SCI_SETSELBACK(bool useSetting, colour back)
needs to be used. If it is about the other matches then it is smart highlighting
and what are you talking about? -
@Ekopalypse said in [New Plugin] ExtSettings:
what are you talking about?
After finishing the topic “selection highlighting” @tomasz1986 started talking about “current line highlighting”. I’ve messed up things in my answer and wanted to clarify later on. But I think we should let it go now…
-
@Ekopalypse said in [New Plugin] ExtSettings:
and what are you talking about?
Yeah, I was just happy that I could set “filling alpha” to “0” and “outline alpha” to “255”, so that Smart Highlighting would show only border with no background colour (which is the same as in Sublime Text, by the way). Then, I started asking about doing the same for ordinary (i.e. not smart) text selection, and the discussion went from there.
-
@dinkumoil I think I have found a small issue regarding the plugin’s settings and about windows. When I open any of them, and then switch to a different program in Windows, it is impossible to go back to Notepad++ by clicking its taskbar button. I can only go back by using Alt+Tab. Just for reference, as I have not checked other Windows versions, this is happening in Windows 7 Enterprise x64 with Classic Theme enabled.
-
@tomasz1986 said in [New Plugin] ExtSettings:
found a small issue regarding the plugin’s settings … When I open any of them, and then switch to a different program in Windows, it is impossible to go back to Notepad++ by clicking its taskbar button.
Thank you, I will have a look at that.
-
another one :-) (npp doesn’t use it at all as far as I can see)
The differences, between 0 and 1, are more visible on the display as
in the image but I guess still noticeable.my default font size
max font size
-
Which “technology” do you prefer? I don’t see much if any difference.
-
the most difference, on my machine, is between 0 and 1.
And SC_TECHNOLOGY_DIRECTWRITE (1) is the one I used for some time now
and I like it with Roboto Mono font.
Between 1 and [2, 3] the changes are only visible, again, on my machine, when
zooming in as much as possible.
But I understand, that this might, depending on your directx settings and usage, be a different experience compared to mine.
If I change from 1 to 0 everything is MUCH thinner and harder to read.
(Everything means, of course, within scintilla only) -
I did some testing using NppExec plugin to send the Scintilla events. The only differences between
SC_TECHNOLOGY_DEFAULT
(value0
) and the other technology modes are:- Characters get slightly wider and higher
- It is possible to use
SCI_INDICSETSTYLE 29 INDIC_GRADIENT
andSCI_INDICSETSTYLE 29 INDIC_GRADIENTCENTRE
to set search match highlighting to these gradient modes.
I even don’t see the slight difference in font weight between
SC_TECHNOLOGY_DEFAULT
and the other modes that I can see in your first set of screen shots above. I use Source Code Pro font.All in all, I have to thoroughly think about whether it’s worth to include this setting in my plugin.
-
just to make it clear - it is all up to you to decide what you want to include into
your plugin and what you don’t want, I appreciate EVERY decision.
I come across of those settings just because of testing my scintilla wrapper
and see that there is something new or old, and remember that I’m actually
using it, and thinking it might fit into your plugin but as said,
those are ALWAYS just proposals. -
@dinkumoil said in [New Plugin] ExtSettings:
I even don’t see the slight difference in font weight between
SC_TECHNOLOGY_DEFAULT
and the other modes that I can see in your first set of screen shots above. I use Source Code Pro font.All in all, I have to thoroughly think about whether it’s worth to include this setting in my plugin.
Just for the record, font rendering is very heavily dependent both on the operating system, the monitor, the font, the user himself, and possibly many other variables. Just as an example, the exact same font, with the same type of rendering, may still look very different depending on the screen (e.g. CRT vs LCD, or TN vs IPS vs VN, etc.) which is being used.
Also, some people are simply more susceptible and notice even slight differences like that much more easily. I have personally experimented with different font rendering in Windows, and find the old GDI rendering much better for my eyes, while DirectWrite rendered text looks fuzzy to the point that I start to feel dizzy when trying to read it for a longer period of time. But again, this is just my case, and the situation may be totally reverse for someone else.
-
Hi, @dinkumoil, and All,
Thank you very much, @dinkumoil, for this very useful plugin, with numerous options ;-))
Some points concerning the options ( From top to bottom and from left to right ! ) :
-
Backspace unindents : Seems very useful when coding, but more accessory with simple text
-
Indentation guide lines : I could not be able to see the difference between the
Python style
andStandard style
options ! -
White space style : IMO, the term
Everywhere visible
would be more appropriate thanAlways visible
, in the drop-down list. But , don’t bother about this ! -
White space size : To my mind, only sizes from
2
to4
seem practically exploitable ! Of course, a click on the Show All Characters icon, in the Toolbar or selection of the optionsView > Show Symbol > Show White Space and TAB
orView > Show Symbol > Show All Characters
resets the size of the space symbol to the default2
value -
Upper line spacing and Lower line spacing : I did some tests with the line below, containing some underscore characters (
\x5f
), followed with some macron characters (\xaf
)
____________________¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
And it happened that, with the Courier New default font :
-
-
Any size <
-2
, for Upper line spacing, does not display the macron characters -
Any size <
-1
, for Lower line spacing, does not display the underscore characters. However, depending of the zoom factor, even the-1
value may not display the_
.
-
Conclusion : the suitable values, whatever the zoom factor, seem to be :
-
-
Any value
>= -2
for upper line spacing -
Any value
>= 0
for upper line spacing
-
-
Now, the vertical lines new feature is really interesting ;-)) Of course, if, after defining some of them, with your plugin, you enable the Vertical Edge Settings in
Settings > Preferences... > Editing
or switch from optionLine Mode
toBackground mode
or vice-versa, it deletes all the previous vertical lines defined and displays the classical vertical edge line ! -
Wrap mode : Again, I did not see any difference between the options
Word boundaries
andWhitespace characters
, of the drop-down list :-( -
Line number margin : Didn’t know this particularity. Nice !
-
Wrapping markers close to text may interest some people. I, personally, prefer that these marks remain at each extremity of the window, for better readability !
-
To be analog to the Notepad++ description, may be the
Mark Highlighting
title of the section should be renamedSmart Highlighting
-
-
Now, the numerous styles proposed to show the Smart Highlighting are valuable. I particularly like the
3
styles
Straight box
,Underlined (2px, inset)
andColorized text
, rather visible and easily identifiable from other N++ highlighting styles ! -
However, note that if you’ve changed the color of the Smart Highlighting, as soon as you switch for an other opened document, and switch back, immediately, to your initial document, any smart Highlighting zones is colored with the default green color :-(( I don’t even know, if this issue could be easily coded ?
-
Strangely, if you disable and re-enable the Smart Highlighting in
Settings > Preferences... > Highlighting
, while not changing current document, does keep the modified color of the Smart Highlighting !
-
-
Cursor beyond line endings : For adepts of the Virtual Space feature. Can be interesting if you need to easily write very far from current line ending !
-
Wrap cursor at line start : Seemingly, when your file contains lines of very different length and some very long lines, this feature prevents you from moving to the end of the previous line. However, why not use, instead, the Down and
Up
arrows keys to navigate, while keeping the same columns visible ? Just tell me what I miss, here ! -
Select full line : Again, I don’t see an immediate advantage to that feature !
-
Selection alpha : I spent more than a month to study color, in many aspects and how calculate the blending of two colors, involving the
α
factor, as well as some practical results relative to our beloved editor ! Refer below :
https://community.notepad-plus-plus.org/post/47895
So, if we consider, in
RGB
mode :-
-
The default current text foreground color
(0,0,0)
-
The default current text background
(255,255,255)
-
The default selection color
(192,192,192)
-
The default current line background color
(232,232,255)
-
The alpha option allows you to change, both, the color of background and foreground ( text ) of the resulting selection, according to the two general formulas :
RESULTING Selection Background = α x SELECTION Background + ( 1 - α ) x CURRENT Background with α in range [0,1] RESULTING Selection Foreground = α x SELECTION Foreground + ( 1 - α ) x CURRENT Foreground with α in range [0,1]
In other words, with
α
, transposed in range[0-255]
, we get :Resulting Bg Red = ( α x 192 + ( 255 - α ) x 255 ) / 255 for part of selection NOT in CURRENT line Resulting Bg Green = ( α x 192 + ( 255 - α ) x 255 ) / 255 for part of selection NOT in CURRENT line Resulting Bg Blue = ( α x 192 + ( 255 - α ) x 255 ) / 255 for part of selection NOT in CURRENT line Resulting Bg Red = ( α x 192 + ( 255 - α ) x 232 ) / 255 for part of selection in CURRENT line Resulting Bg Green = ( α x 192 + ( 255 - α ) x 232 ) / 255 for part of selection in CURRENT line Resulting Bg Blue = ( α x 192 + ( 255 - α ) x 255 ) / 255 for part of selection in CURRENT line And : Resulting Fg Red = ( α x 192 + ( 255 - α ) x 0 ) / 255 = α x 192 / 255 WHATEVER the selection location Resulting Fg Green = ( α x 192 + ( 255 - α ) x 0 ) / 255 = α x 192 / 255 WHATEVER the selection location Resulting Fg Blue = ( α x 192 + ( 255 - α ) x 0 ) / 255 = α x 192 / 255 WHATEVER the selection location
-
-
As
α
value increases towards255
, the gray colors of selected text and the background converge, reducing contrast between them and, whenα
=255
, color of Fg = color of Bg =(192,192,192)
, leading to an invisible selected text !! -
On the contrary, as
α
value decreases towards0
, the selection background becomes more and more transparent and, whenα
=0
, color of Fg =(0,0,0)
and color of Bg =(255,255,255)
, except for the part within current line where color of Bg =(232,232,255)
-
So, in the end, only values between
120
and150
and, of course,256
seem interesting ! Value130
seems a good compromise !
-
-
The Multi Paste and Convert EOL on paste seems rather useful and I see very few interest in unchecking them :-))
-
To conclude, although I can’t test printing, presently, the Magnification feature is surely valuable, as I don’t see anything about it, in the
Settings > Preferences... > Print
panel !
Now, @Dinkumoil, more generally :
-
I think that the
Close
button should be selected, by default, in order to close while hitting theEnter
key . May be, the possibility to close, while hitting theESC
key would be nice, too ! -
Could you give the user the opportunity to get multiple configurations ? For instance, regarding the vertical lines, we could have a configuration
1
with some vertical lines, a configuration2
with other vertical lines starting at other columns and having other colors, and so on…
Probably, your
.ini
file could memorize ( Be sensible ! ) up to5
completely different configurations. Just my idea ! Of course, your new window would give us the choice of the configuration to activate ;-))-
Could you consider adding the
SCI_SETCARETSTICKY
feature (2458
). Do you know it ?-
Let’s suppose the caret is at column
c
, linen
, in current N++ window -
Then, you type in some text
-
Now, hitting the
Down
/Up
arrow, the caret is automatically located linen+1
/n-1
, at the same columnc
-
You may decide, afterwards, of an other location column
c1
and/or in an other linen1
, with either a mouse click or a keyboard action -
Type in, again, some chars, from column
c1
-
As soon as you use the
Down
/Up
arrow, the caret is moved on next / previous line, at the samec1
column
-
Note the
3
possibilities :0
=> Disabled,1
=> Always enabled and2
Enabled only after typing Tab and Space charsOf course, this feature is useful only when inserting different text, on the consecutive lines reached. Indeed, when text, to be inserted, is identical throughout all lines, the built-in column mode is more intuitive ;-))
- More anecdotal, you could, also, consider the
SCI_SETMARGINLEFT
(2155
) andSCI_SETMARGINRIGHT
(2157
) settings, which set the width of the blank margin, on both sides of text, in pixels ?
As always, just propositions ! Do as you like ;-))
Best Regards,
guy038
-