When one of the swapping buffers is in a dedicated window, only the other buffer is changed. So, to avoid that behavior I did this improvement: . . .
It'll be nice if you could patch the official one.