Fix edit and undo for edit in InputParser

Undo for edit was not working. This commit fixes it.