Add close prompt and clean whitespace on save hook.