File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -55,3 +55,41 @@ func Test_changedtick_fixed()
5555 call assert_fails (' unlet d["changedtick"]' , ' E46:' )
5656
5757endfunc
58+
59+ func Test_changedtick_not_incremented_with_write ()
60+ new
61+ let fname = " XChangeTick"
62+ exe ' w ' .. fname
63+
64+ " :write when the buffer is not changed does not increment changedtick
65+ let expected = b: changedtick
66+ w
67+ call assert_equal (expected, b: changedtick )
68+
69+ " :write when the buffer IS changed DOES increment changedtick
70+ let expected = b: changedtick + 1
71+ setlocal modified
72+ w
73+ call assert_equal (expected, b: changedtick )
74+
75+ " Two ticks: change + write
76+ let expected = b: changedtick + 2
77+ call setline (1 , ' hello' )
78+ w
79+ call assert_equal (expected, b: changedtick )
80+
81+ " Two ticks: start insert + write
82+ let expected = b: changedtick + 2
83+ normal ! o
84+ w
85+ call assert_equal (expected, b: changedtick )
86+
87+ " Three ticks: start insert + change + write
88+ let expected = b: changedtick + 3
89+ normal ! ochanged
90+ w
91+ call assert_equal (expected, b: changedtick )
92+
93+ bwipe
94+ call delete (fname)
95+ endfunc
Original file line number Diff line number Diff line change @@ -767,6 +767,8 @@ static char *(features[]) =
767767
768768static int included_patches [] =
769769{ /* Add new patch number below this line */
770+ /**/
771+ 1501 ,
770772/**/
771773 1500 ,
772774/**/
You can’t perform that action at this time.
0 commit comments