[New Plugin] ExtSettings
-
I also very much like being able to modify the match highlighting colours separately, so that it is possible to only have the border visible with no background colour, like below.
I am not allowed to edit the post above any more, so I just want to clarify that I meant the colour filling settings, and not some kind of multiple colours.
In relation to this, I also have a question - is it possible to have this kind of highlighting customisation for the ordinary text selection too, or is it limited to the smart highlighting only?
-
@tomasz1986 said in [New Plugin] ExtSettings:
is it possible to have this kind of highlighting customisation for the ordinary text selection too
You can configure the background color of selected text in the style configurator.
Go to
(menu) Settings -> Style Configurator -> (list box) Style -> Selected text colour -> (group box) Colour Style -> Background colour
.Click on the colored panel to open a color selection dialog.
With my plugin you can set the alpha value for selected text.
@all
To provide the same configuration options for selected text as for match highlighting I have to know how highlighting of selected text is implemented internally. Is it a certain indicator like match highlighting (its number is 29, thanks to @Ekopalypse who pointed that out somewhere)? -
selected text is handled internally by scintilla with SCI_SETSELFORE and SCI_SETSELBACK
-
@dinkumoil - btw. there is no SCI_GET… equivalent of those calls, so if it is
needed to store the default value in case of resets then you have to read the
config.xml to get the current used styler.xml/theme.xml and read the value from there. :-( -
@Ekopalypse
Thank you for providing these information.@tomasz1986
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. -
@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.