Fix Selected text changes color issue when editor window loses focus

Fix #11743
This commit is contained in:
Don Ho 2022-06-07 01:08:20 +02:00
parent d65967deab
commit b6efff4157
1 changed files with 5 additions and 1 deletions

View File

@ -2617,7 +2617,11 @@ void ScintillaEditView::performGlobalStyles()
execute(SCI_SETELEMENTCOLOUR, SC_ELEMENT_SELECTION_INACTIVE_BACK, selectColorBack); execute(SCI_SETELEMENTCOLOUR, SC_ELEMENT_SELECTION_INACTIVE_BACK, selectColorBack);
if (nppParams.isSelectFgColorEnabled()) if (nppParams.isSelectFgColorEnabled())
execute(SCI_SETSELFORE, 1, selectColorFore); {
long alphaSelectColorFore = selectColorFore;
alphaSelectColorFore |= 0xFF000000; // add alpha color to make DirectWrite mode work
execute(SCI_SETELEMENTCOLOUR, SC_ELEMENT_SELECTION_INACTIVE_TEXT, alphaSelectColorFore);
}
COLORREF caretColor = black; COLORREF caretColor = black;
pStyle = stylers.findByID(SCI_SETCARETFORE); pStyle = stylers.findByID(SCI_SETCARETFORE);