[BUG] UDL Switching Dark to Light

Author: pryrtCreated Sep 17, 2026Updated Sep 17, 2026

Is there an existing issue (open or closed) for this?

  • I have searched the existing issues

Is the issue reproducible in Notepad++ without plugin?

  • 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

While working on #18387, I found that when you have a UDL that has versions for darkModeTheme="yes" and not, if you have the markdown file open when you switch modes, it will still use the old colors and UDL, rather than switching. But if you close the file and reopen it after changing mode (Ctrl+W, Ctrl+Shift+T), it will pick the correct UDL for that mode.

Steps To Reproduce

  1. Open blah.md in Light Mode ⇒ see that Markdown (preinstalled) is correctly selected
  2. Settings > Preferences > Dark Mode, choose Dark Mode ⇒ blah.md still using Markdown (preinstalled) colors and language chosen
  3. Ctrl+W, Ctrl+Shift+T to close/reopen ⇒ it now uses Markdown (preinstalled dark mode) as expected
  4. Settings > Preferences > Dark Mode, choose Light Mode ⇒ blah.md still using Markdown (preinstalled dark mode) colors and language chosen
  5. Ctrl+W, Ctrl+Shift+T to close/reopen ⇒ it now uses Markdown (preinstalled) as expected

Current Behavior

File stays on the old mode's UDL rather than auto-swapping

Expected Behavior

File should automatically switch from one UDL to the other when switching from Light to Dark or vice versa

Debug Information

bash
Notepad++ v8.9.8   (64-bit)
Build time: Aug 23 2026 - 17:22:44
Scintilla/Lexilla included: 5.6.6/5.5.3
Boost Regex included: 1_90
pugixml included: 1.16
nlohmann JSON included: 3.12.0
Path: C:\\\usr\local\apps\npp\npp.8.9.8.portable.x64\notepad++.exe
Command Line: 
Admin mode: OFF
Local Conf mode: ON
Cloud Config: OFF
WinGUp: present
disableNppAutoUpdate.xml: present
Periodic Backup: ON
Placeholders: OFF
Scintilla Rendering Mode: SC_TECHNOLOGY_DIRECTWRITE (1)
Multi-instance Mode: monoInst
asNotepad: OFF
File Status Auto-Detection: cdEnabledNew (for current file/tab only)
Dark Mode: OFF
Display Info:
    primary monitor: 1920x1080, scaling 100%
    visible monitors count: 1
    installed Display Class adapters: 
        0000: Description - Intel(R) UHD Graphics 770
        0000: DriverVersion - 32.0.101.7085
OS Name: Windows 11 Home (64-bit)
OS Version: 25H2
OS Build: 26200.9457
Current ANSI codepage: 1252
Plugins: 
    Explorer (1.9.9)
    mimeTools (3.1)
    NppConverter (4.7)
    NppExport (0.4)

Anything else?

No response

Source: notepad-plus-plus/notepad-plus-plus