[BUG] auto-completion selection/highlight is illegible in dark mode
Is there an existing issue for this?
- [x] I have searched the existing issues
Is the issue reproducible in Notepad++ without plugin?
- [x] I have tried Notepad++ without plugin
Is the issue reproducible in portable version of Notepad++?
- [ ] I have tried portable version of Notepad++
Does the issue affect SciTE?
- [ ] I have tried SciTE
Description of the Issue
This might be related to #10792 but I don't think so. I could not find any other issue that mentions this.
The autocomplete popup is very difficult to use in dark color schemes:
It is nearly impossible to see what item is selected.
In the default color scheme, it is perfectly easy to see:
I have searched high and low, but I can't find this color anywhere in stylers.xml. The blue color for "selected" would be fine on this particular theme, and it is used in other parts of the UI even while dark:
This is an issue with nearly every dark theme, including the default, Zenburn, and others such as Bespin. It is not clear to me where it gets the highlight color, but some are slightly better than others.
Steps To Reproduce
- Configure Dark Mode and Auto-Completion
- Bring up autocomplete popup
Current Behavior
See above screenshots.
Expected Behavior
I expected that I could set this color in the theme's stylers.xml, or that it would simply use the same highlight color from the rest of the UI (see above screenshots).
Debug Information
Notepad++ v8.8.7 (32-bit)
Build time: Oct 17 2025 - 01:43:53
Scintilla/Lexilla included: 5.5.7/5.4.5
Boost Regex included: 1_85
Path: C:\Program Files (x86)\Notepad++\notepad++.exe
Command Line:
Admin mode: OFF
Local Conf mode: OFF
Cloud Config: OFF
Periodic Backup: OFF
Placeholders: OFF
Scintilla Rendering Mode: SC_TECHNOLOGY_DEFAULT (0)
Multi-instance Mode: monoInst
asNotepad: OFF
File Status Auto-Detection: cdEnabledNew (for current file/tab only)
Dark Mode: ON
Display Info:
primary monitor: 1920x1200, scaling 100%
visible monitors count: 3
installed Display Class adapters:
0001: Description - NVIDIA GeForce RTX 3070
0001: DriverVersion - 32.0.15.7680
0002: Description - Virtual Desktop Monitor
0002: DriverVersion - 13.50.53.699
0003: Description - Virtual Display Driver by MTT
0003: DriverVersion - 10.26.6.91
OS Name: Windows 10 Enterprise (64-bit)
OS Version: 22H2
OS Build: 19045.6456
Current ANSI codepage: 1252
Plugins:
AnalysePlugin (1.13.49)
AutoCodepage (1.2.4)
AutoEolFormat (1.0.2)
BookmarksDook (2.3.3)
CustomLineNumbers (1.1.7)
DoxyIt (0.4.4)
DSpellCheck (1.4.24)
MarkdownViewerPlusPlus (0.8.2)
mimeTools (3.1)
MultiClipboard (2.1)
NppConverter (4.7)
NppExport (0.4)
PlantUmlViewer (1.4.0.8)
QuickText (0.2.5.1)
Anything else?
No response
In Dark Mode Default, when the Default Style > BG = 3F3F3F, the highlighted word in the auto-complete pulldown gets 3F3F3F, and the others get 2B2B2B. As mentioned in the other issue you linked, the slightly darker color is computed relative to that
Similarly, if I change BG to FF8080, then the highlighted auto-complete is FF8080, and the others are the slightly darker EB6C6C.
So it looks like it's always subtracting 141414, which makes each color 20/256 darker than it was before
But if it starts at 000080 (dark blue), then the computed will be 00006C -- the other colors obviously cannot go negative, so only the blue term changes by 20 codes (0x14 in hex). And 20 codes different for just a single color is not as noticeable as 20 codes different for each color for 3 colors.
I haven't looked into the source code on this, so I don't know whether it's literally subtracting 0x14 from each (clamping to 0x00), or whether it's applying a mask/overlay color (maybe 10% alpha, or combining with some other color).
I expected ... or that it would simply use the same highlight color from the rest of the UI
The highlighted term is actually using the Default Style's background color (so one of the editor colors, not the UI color), and the non-highlighted terms are using the Darker-by-0x141414 (or, when the background color is white, then the highlighted is blue and the non-highlighted are the default white background)
Doing some more research, accoriding to https://github.com/notepad-plus-plus/notepad-plus-plus/issues/11036#issuecomment-1359720482, StyleConfigurator entries for the auto-complete colors were suggested and even a PR was made... but in the end, it was replaced with the "computed color" based on the background color. So this issue is effectively a duplicate of #11036 and #11522.
I agree that it would be nice to allow the user to decide how much contrast is needed, because often a difference of 0x141414 isn't enough to provide good contrast (and being able to provide a completely different color can help with people who have difficulty distinguishing different shades). But given that it was tried must customizable once, and then intentionally changed to the way it now is, I don't know how successsful it will be to ask for more-configurable again at this point....
Your explanation sounds plausible, and that would explain why dark themes are impossible to differentiate, however I'm having trouble squaring it with the light theme, which is clearly just using a different color (blue, see screenshot above). So it has different behavior for light vs. dark themes? I'm having trouble understanding why the Darker-by-0x141414 method would only be used on themes for which it is ill-suited.
Edit:
I found out why. There is special code for when BG=white: https://github.com/notepad-plus-plus/notepad-plus-plus/blob/master/PowerEditor/src/Notepad_plus.cpp#L6467
@dhowland Can use the PythonScript plugin to customize the background colour of selected item in autocompletion lists.
from Npp import editor, notepad
def main():
'''Background colour of selected item in autocompletion lists.'''
dark = notepad.getEditorDefaultBackgroundColor() < (96, 96, 96)
if not dark:
return
# RGBA preset background colours.
colour = ((0, 120, 215, 255), # 0 mid blue
(0, 50, 150, 255)) # 1 dark blue
SC_ELEMENT_LIST_SELECTED_BACK = 3
editor.setElementColour(SC_ELEMENT_LIST_SELECTED_BACK, colour[1])
main()
Mid blue is like in the images. Dark blue may make the selected item easier to read.
Add to startup.py. Ensure configuration is set to run ATSTARTUP instead of LAZY.
FAQ : How to install and run a script in PythonScript
I have prepared a patch that fixes this correctly. I will submit a pull when I am confident that I am understanding the contribution guidelines.
It was reverted by https://github.com/notepad-plus-plus/notepad-plus-plus/commit/0ee65fd82687d741220739cec04b89c2247dd4eb and IIRC because themes at that time didn't have code for inserting missing entries in styler.
because themes at that time didn't have code for inserting missing entries in styler
Ooh, if that was the reason, then since insert-missing-entries was just recently added to the codebase, it might improve the chances of the more-configurable auto-completion colors getting re-added to the codebase if @dhowland does submit a new PR.