neoformat
neoformat copied to clipboard
truncating files
When I have this plugin installed and I save changes to a large file (10000 lines or more), sometimes hundreds of lines at the end of the file get deleted. So far I have only noticed this in very large Markdown files. I suspect what is happening is that when I enter ":w" to write the file, neoformat begins formatting the file and before it can finish, the part it has formatted so far gets written out. I can reproduce the issue by adding a markdown table anywhere in the file and entering ":w". For example, something like this:
| foo | bar |
|-|-|
| test | this |
Neoformat adjusts all the cell widths in the Markdown table to line up nicely which I love.
It seems that if I type ":w" and wait two seconds before pressing the return key, this does not happen. So I suspect it is a timing issue related to giving the formatting time to finish before writing out the file.