The BufWriteCmd event:
Fires:
radio_button_unchecked
Before writing the entire buffer to a file.
Notes:
radio_button_unchecked
The callback should not change the buffer contents.
radio_button_unchecked
The callback should write the file and reset 'modified' if successful, unless '+' is in 'cpo' and writing to another file cpo-+.
radio_button_unchecked
When the command resets 'modified' the undo information is adjusted to mark older undo states as 'modified', like :write does.