I do not know, if the attached source is ok, but it works for me.
You might want to extend the patch for 'NppIO.cpp' as method 'Notepad_plus::notifyBufferActivated' does i.e.:
if (_pFuncList && (!_pFuncList->isClosed()) && _pFuncList->isVisible())
That's the correct way.
This enhancement has been committed last night, and will be in the next release.
Thanks for the hint.
I changed it and it works as expected.
p.s. I have updated the patchfile