Added a short bit of code to intelligently integrate the system clipboard based on the status of the current region.