Editor switching should keep dirty text and selection

fix for issue #208