> 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 [email protected] > Übersetzt von [email protected] > Riesige Version mit GTK2 GUI. > - I did my tests in an xterm, without the GUI.
I cannot reproduce it. This may very well depend on the exact content of the file and position of line breaks. Vim 8.1 is quite old, please try with a newer version. -- If Microsoft would build a car... ... You'd have to press the "Start" button to turn the engine off. /// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net \\\ /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ \\\ an exciting new programming language -- http://www.Zimbu.org /// \\\ help me help AIDS victims -- http://ICCF-Holland.org /// -- -- You received this message from the "vim_dev" maillist. Do not top-post! Type your reply below the text you are replying to. For more information, visit http://www.vim.org/maillist.php --- You received this message because you are subscribed to the Google Groups "vim_dev" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/vim_dev/202101182130.10ILUHSc1011821%40masaka.moolenaar.net.
