Hi vim team,
thank you for developing vim.
I discovered the following strange behaviour; seems to be a bug:
Swap file recovery fails, when the only change was adding a one character line.
Steps to reproduce:
First create a text file OPT.txt to play with (I take a copy of a help page)
vim -u NONE
:help options
:w OPT.txt
:q
Edit OPT.txt and add a new line just containing x after line 5000
vim -u NONE OPT.txt
:5000
ox<Esc>
Wait some seconds for the swap file to be written out.
Then without having saved, on another terminal kill vim
kill -9 <PID>
Recover and save the result as new file
vim -u NONE -r OPT.txt
:w OPT_recovered.txt
:q!
Diff to see what we got
diff -s OPT.txt OPT_recovered.txt
What I would expect as output from the diff:
5000a5001
> x
What I get instead:
5040a5041
> Lisp mode: When <Enter> is typed in insert mode set the indent for
I. e. 40 lines further down any line got duplicated; that is something
completely different than what I did (adding the line with the x).
I can reproduce this with any play file; you can also create a play file by
starting with an empty file and then
10000ohello<Esc>
When instead I add two x instead of one
oxx<Esc>
then everything works fine, and I get as output from the diff
5000a5001
> xx
Could you please have a look at it?
System information:
- Debian 10
- Package vim-gtk/stable,stable,now 2:8.1.0875-5 amd64
- Output from :version is:
VIM - Vi IMproved 8.1 (2018 May 18 kompiliert am Jun 15 2019 16:41:15)
Inklusive der Patches: 1-875, 878, 884, 948, 1046, 1365-1368, 1382, 1401
Verändert von
team...@tracker.debian.org
Übersetzt von
team...@tracker.debian.org
Riesige Version mit GTK2 GUI.
- I did my tests in an xterm, without the GUI.
Thank you and have a good time!
Paul