-
-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Transparent cursor line turns completely black when changing style in NPP 8.6 #77
Comments
You're right I can reproduce this in v8.6, but not in v8.5.3 or v8.5.8. There was a work-around for a similar issue in combination with using the ComparePlugin, but that doesn't seem to work for this issue with the Style Configurator. Another work-around is to just disable the transparent cursor line for now. You can go to I suspect it has to do with this fix in Notepad++ I'll have to look into this |
Thanks for commenting about CSV Lint! I had updated it recently and then noticed the background highlighting issue happening and was driving me a little crazy. Note to anyone else that you need to restart Notepad++ after to have the highlighting working as indented. |
The following can be added to the collection of linked issues, above: |
Hey, @BdR76, wanna try this? diff --git a/CSVLintNppPlugin/Main.cs b/CSVLintNppPlugin/Main.cs
index b37a876..fb95ff5 100644
--- a/CSVLintNppPlugin/Main.cs
+++ b/CSVLintNppPlugin/Main.cs
@@ -19,6 +19,8 @@ namespace Kbg.NppPluginNET
class Main
{
internal const string PluginName = "CSV Lint";
+ public static readonly int sCaretLineBackAlpha = 0x18000000;
+ public static readonly int sCaretLineBackAlphaDarkMode = 0x40CCCCCC;
public static Settings Settings = new Settings();
public static CultureInfo dummyCulture;
@@ -191,12 +193,17 @@ internal static void RefreshFromSettings()
if (Settings.TransparentCursor)
{
var editor = new ScintillaGateway(PluginBase.GetCurrentScintilla());
- if (editor.GetCaretLineBackAlpha() == Alpha.NOALPHA)
+ var rgba = editor.GetElementColour(Element.CARET_LINE_BACK);
+ if (CheckConfigDarkMode() && rgba.Value != sCaretLineBackAlphaDarkMode)
{
- editor.SetCaretLineBackAlpha((Alpha)16 + 8);
- //editor.SetCaretLineBack(sCaretLineBack);
- editor.SetCaretLineBack(new Colour(0)); // Main.CheckConfigDarkMode() ? 0xFFFFFF : 0
+ rgba = new ColourAlpha(sCaretLineBackAlphaDarkMode);
}
+ else if (!CheckConfigDarkMode() && rgba.Value != sCaretLineBackAlpha)
+ {
+ rgba = new ColourAlpha(sCaretLineBackAlpha);
+ }
+ editor.SetElementColour(Element.CARET_LINE_BACK, rgba);
+ editor.SetCaretLineLayer(Layer.UNDER_TEXT); // *IMPORTANT*
}
}
The crucial part is sending SCI_SETCARETLINELAYER with |
Thanks for the suggestion, but using the |
comparePlus 1.2.0 was supposed to mitigate that issue: I don't know what more @pnedev can do without compromising his own users' experience. If it were up to me, I would think about retiring the transparent caret line feature; or at least adding some kludge to disable it whenever comparePlus is installed, e.g. INotepadPPGateway npp = new NotepadPPGateway();
Settings.TransparentCursor =
(Directory.GetDirectories(Directory.GetParent(npp.GetPluginConfigPath())?.FullName, "comparePlus")?.Length == 0); |
Hi guys, I have no idea what more I can do from ComparePlus to make things better. BR |
Let's not forget that Notepad++ finally adopted translucent 32-bit colors in the "Anniversary Edition" (8.6): notepad-plus-plus/notepad-plus-plus@0917875 A good time to drop a plugin feature is when the host application starts providing the same thing natively. |
With Windows 11 the problem with the hidden text only appears when I have set the theme to "Follow Windows". Then both dark and light theme show that issue. When I manually choose light or dark theme the issue is gone. |
I finally had some time to look at this issue again, bu tI'm still struggling to find a good solution.
I've updated Notepad++ to the latest version v8.6.7 including a "refresh" of the So afaik there is no way to set the caret-line to transparency using just the default Notepad++ functionality, can you confirm that this is correct? |
@rdipardo So next, I tried changing the code in CSV Lint that sets the transparent cursor line. I've looked at the ComparePlus code see here by @pnedev However, I'm struggling to get the "new way" to work correctly. I've changed it to this (code below, the hardcoded values are for testing) but then the caret line is not changed at all, the code is executed but the caret line is just the default opaque purple-ish line.
|
I can't test any code right now since I don't have the .NET 3.5 tools installed (the reason why that's an issue is explained here: https://community.notepad-plus-plus.org/post/93190). In the meanwhile I would recommend a bit of preventative maintenance: go to the Main class definition and change it to Why? The Main class has tons of static members that need to be initialized as soon as possible (in practice, whenever |
Thanks for the preventative maintenance tip, that sounds like good advice, it might also be the cause of this issue #90 However, when I also change |
In the new version 8.6 of Notepad++ if I change my style (Settings > Style Configurator … > Select theme), or just open the Select-theme-combobox and cancel, the current line background appears unreadable/black like in #68. Even without opening CSVLint.
… until I restart Notepad++, then it’s again as it should be:
The text was updated successfully, but these errors were encountered: