b4n approved this pull request.
LGTM. Indeed, we didn't handle the case where the theme would set a specific foreground color for the selected text, separate from the one for unselected text. I don't have such a theme, but the changes here look sensible to me, and should be harmless otherwise (but if someone changed the colors and now has to override this as well, but that's something I think we can live with).