Closed rdipardo closed 10 months ago
@rdipardo ,
Thanks for reporting this and for the analysis. Notepad++ by default sets the caret line background color to 0xFFE8E8 and the layer used is SC_LAYER_BASE. Because in ComparePlus I'd like to make the diff color background visible when the caret is on its line and also the text should be visible (not blurred by alpha on upper layer) I change the caret line layer to SC_LAYER_UNDER_TEXT and set an alpha to the caret line background color. After compare is closed I would like to restore the view as Notepad++ has configured it.
Now if some other plugin also changes caret background color it will for sure interfere with ComparePlus.
If for example one plugin changes the color and then other plugin changes it immediately afterwards (on some event - in ComparePlus case it is notification about activation of another doc) then it is very important how the Notepad++ original setting will be restored. I will do some tests with CSVLint and ComparePlus when I get to this and will see if I can improve the things on my side.
BR
Hi guys,
That is the best I can do : https://github.com/pnedev/comparePlus/commit/a374a82131a53f4c4e6fbc5ad397899d9cfc1091 I'm closing this issue now - please write again here if you think there is still something that can be done better.
Thanks. BR
Steps to Reproduce
Set the caret line background to a translucent color, e.g.
0x28FF009C
; for example, by executing this NppExec script:Before opening the compare view, the caret line background should be translucent:
Open the compare view; close it again.
The caret line background is now solid:
Problem code path
The
setNormalView
function uses a 24-bit BGR color mask that clears the top 8 alpha bits; it also sets theSC_LAYER_BASE
flag, which will cancel transparency effects in any case:https://github.com/pnedev/comparePlus/blob/64a9ee43bbda6755a0cdb784e6b1b3decdb0af6f/src/NppHelpers.cpp#L376-L382
This could be seen as a negative interaction with user scripts and other plugins that customize the caret line background. There's a least one case of a plugin developer thinking that the alpha channel was disappearing because of a bug in his own code.
Version
1.1