Mercurial > vim
comparison src/testdir/test_undo.vim @ 17630:380adf86bf66 v8.1.1812
patch 8.1.1812: reading a truncted undo file hangs Vim
commit https://github.com/vim/vim/commit/fb06d767a8d76eead5391302fc88115d6e3879d8
Author: Bram Moolenaar <Bram@vim.org>
Date: Sun Aug 4 18:55:35 2019 +0200
patch 8.1.1812: reading a truncted undo file hangs Vim
Problem: Reading a truncted undo file hangs Vim.
Solution: Check for reading EOF. (closes https://github.com/vim/vim/issues/4769)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Sun, 04 Aug 2019 19:00:04 +0200 |
parents | 16a698aeeec1 |
children | 11dca9732a48 |
comparison
equal
deleted
inserted
replaced
17629:a85a222d1a34 | 17630:380adf86bf66 |
---|---|
333 bwipe! | 333 bwipe! |
334 call delete('Xfile') | 334 call delete('Xfile') |
335 call delete('Xundofile') | 335 call delete('Xundofile') |
336 endfunc | 336 endfunc |
337 | 337 |
338 " Check that reading a truncted undo file doesn't hang. | |
339 func Test_undofile_truncated() | |
340 new | |
341 call setline(1, 'hello') | |
342 set ul=100 | |
343 wundo Xundofile | |
344 let contents = readfile('Xundofile', 'B') | |
345 | |
346 " try several sizes | |
347 for size in range(20, 500, 33) | |
348 call writefile(contents[0:size], 'Xundofile') | |
349 call assert_fails('rundo Xundofile', 'E825:') | |
350 endfor | |
351 | |
352 bwipe! | |
353 " call delete('Xundofile') | |
354 endfunc | |
355 | |
338 " Test for undo working properly when executing commands from a register. | 356 " Test for undo working properly when executing commands from a register. |
339 " Also test this in an empty buffer. | 357 " Also test this in an empty buffer. |
340 func Test_cmd_in_reg_undo() | 358 func Test_cmd_in_reg_undo() |
341 enew! | 359 enew! |
342 let @a = "Ox\<Esc>jAy\<Esc>kdd" | 360 let @a = "Ox\<Esc>jAy\<Esc>kdd" |