Added logic to determine which editor to set as the default