[Vimode] Do not remove empty lines when reformatting
In vimode, "gqap" also selects empty lines. As an implementation detail, we used joinLines() which happily gobbles up empty lines.
This MR also makes reformatting in vimode a single undoable action.