@@ -212,13 +212,50 @@ func Test_diffoff()
212212 call setline (1 , [' One' , ' ' , ' Two' , ' Three' ])
213213 diffthis
214214 redraw
215+ call assert_notequal (normattr, screenattr (1 , 1 ))
215216 diffoff !
216217 redraw
217218 call assert_equal (normattr, screenattr (1 , 1 ))
218219 bwipe!
219220 bwipe!
220221endfunc
221222
223+ func Test_diffoff_hidden ()
224+ set diffopt = filler,foldcolumn :0
225+ e ! one
226+ call setline (1 , [' Two' , ' Three' ])
227+ let normattr = screenattr (1 , 1 )
228+ diffthis
229+ botright vert new two
230+ call setline (1 , [' One' , ' Four' ])
231+ diffthis
232+ redraw
233+ call assert_notequal (normattr, screenattr (1 , 1 ))
234+ set hidden
235+ close
236+ redraw
237+ " diffing with hidden buffer two
238+ call assert_notequal (normattr, screenattr (1 , 1 ))
239+ diffoff
240+ redraw
241+ call assert_equal (normattr, screenattr (1 , 1 ))
242+ diffthis
243+ redraw
244+ " still diffing with hidden buffer two
245+ call assert_notequal (normattr, screenattr (1 , 1 ))
246+ diffoff !
247+ redraw
248+ call assert_equal (normattr, screenattr (1 , 1 ))
249+ diffthis
250+ redraw
251+ " no longer diffing with hidden buffer two
252+ call assert_equal (normattr, screenattr (1 , 1 ))
253+
254+ bwipe!
255+ bwipe!
256+ set hidden & diffopt &
257+ endfunc
258+
222259func Test_setting_cursor ()
223260 new Xtest1
224261 put = range (1 ,90 )
0 commit comments