undomanager fix and text plugin code formatting change