Fixed issue where the replace window gets closed when switching documents where replace references are found