only set swapfile for non-empty buffer