some updates to edit(), including nano support. ref #4728