Better handling of switching tabs for already open files.