If you have a buffer with changes, and you haven't saved them yet and perform a ':Format' or ':FormatWrite' the formatting is applied to the file contents not the buffer contents so you will lose your changes.
:Format should refuse (by default) to run if the buffer has the 'modified' flag , to prevent data loss.
If you have a buffer with changes, and you haven't saved them yet and perform a ':Format' or ':FormatWrite' the formatting is applied to the file contents not the buffer contents so you will lose your changes.
:Formatshould refuse (by default) to run if the buffer has the'modified'flag , to prevent data loss.