To: vim_dev@googlegroups.com Subject: Patch 7.4.2262 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 7.4.2262 Problem: Fail to read register content from viminfo if it is 438 characters long. (John Chen) Solution: Adjust the check for line wrapping. (closes #1010) Files: src/testdir/test_viminfo.vim, src/ex_cmds.c *** ../vim-7.4.2261/src/testdir/test_viminfo.vim 2016-08-23 23:50:06.872279942 +0200 --- src/testdir/test_viminfo.vim 2016-08-26 20:35:50.849366155 +0200 *************** *** 214,219 **** --- 214,232 ---- call assert_equal(l, getreg('d', 1, 1)) call assert_equal("V", getregtype('d')) + " Length around 440 switches to line continuation. + let len = 434 + while len < 445 + let s = repeat('a', len) + call setreg('"', s) + wviminfo Xviminfo + call setreg('"', '') + rviminfo Xviminfo + call assert_equal(s, getreg('"'), 'wrong register at length: ' . len) + + let len += 1 + endwhile + call delete('Xviminfo') endfunc *** ../vim-7.4.2261/src/ex_cmds.c 2016-08-25 23:19:25.671805229 +0200 --- src/ex_cmds.c 2016-08-26 20:37:57.292291527 +0200 *************** *** 2526,2532 **** else ++len; } ! if (len > remaining) { fprintf(fd, ">%d\n|<", len); remaining = LSIZE - 20; --- 2526,2532 ---- else ++len; } ! if (len > remaining - 2) { fprintf(fd, ">%d\n|<", len); remaining = LSIZE - 20; *** ../vim-7.4.2261/src/version.c 2016-08-26 19:55:57.205594548 +0200 --- src/version.c 2016-08-26 20:37:40.108437586 +0200 *************** *** 765,766 **** --- 765,768 ---- { /* Add new patch number below this line */ + /**/ + 2262, /**/ -- From "know your smileys": ~#:-( I just washed my hair, and I can't do nuthin' with it. /// Bram Moolenaar -- Bram@Moolenaar.net -- 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 ///