Remember state after edit

Fixes #40