To: vim_dev@googlegroups.com Subject: Patch 8.1.1501 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 8.1.1501 Problem: New behavior of b:changedtick not tested. Solution: Add a few test cases. (Daniel Hahler) Files: src/testdir/test_changedtick.vim *** ../vim-8.1.1500/src/testdir/test_changedtick.vim 2017-02-21 20:39:05.000000000 +0100 --- src/testdir/test_changedtick.vim 2019-06-08 20:43:52.668814069 +0200 *************** *** 55,57 **** --- 55,95 ---- call assert_fails('unlet d["changedtick"]', 'E46:') endfunc + + func Test_changedtick_not_incremented_with_write() + new + let fname = "XChangeTick" + exe 'w ' .. fname + + " :write when the buffer is not changed does not increment changedtick + let expected = b:changedtick + w + call assert_equal(expected, b:changedtick) + + " :write when the buffer IS changed DOES increment changedtick + let expected = b:changedtick + 1 + setlocal modified + w + call assert_equal(expected, b:changedtick) + + " Two ticks: change + write + let expected = b:changedtick + 2 + call setline(1, 'hello') + w + call assert_equal(expected, b:changedtick) + + " Two ticks: start insert + write + let expected = b:changedtick + 2 + normal! o + w + call assert_equal(expected, b:changedtick) + + " Three ticks: start insert + change + write + let expected = b:changedtick + 3 + normal! ochanged + w + call assert_equal(expected, b:changedtick) + + bwipe + call delete(fname) + endfunc *** ../vim-8.1.1500/src/version.c 2019-06-08 20:17:14.656519328 +0200 --- src/version.c 2019-06-08 20:47:54.335629423 +0200 *************** *** 769,770 **** --- 769,772 ---- { /* Add new patch number below this line */ + /**/ + 1501, /**/ -- hundred-and-one symptoms of being an internet addict: 126. You brag to all of your friends about your date Saturday night...but you don't tell them it was only in a chat room. /// 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 ///