theend:
diff_busy = FALSE;
if (diff_need_update)
- {
- diff_need_update = FALSE;
ex_diffupdate(NULL);
- }
+
+ // Check that the cursor is on a valid character and update it's
+ // position. When there were filler lines the topline has become
+ // invalid.
+ check_cursor();
+ changed_line_abv_curs();
+
+ if (diff_need_update)
+ // redraw already done by ex_diffupdate()
+ diff_need_update = FALSE;
else
{
- // Check that the cursor is on a valid character and update it's
- // position. When there were filler lines the topline has become
- // invalid.
- check_cursor();
- changed_line_abv_curs();
-
// Also need to redraw the other buffers.
diff_redraw(FALSE);
apply_autocmds(EVENT_DIFFUPDATED, NULL, NULL, FALSE, curbuf);
%bwipe!
endfunc
+func Test_do_lastline()
+ e! one
+ call setline(1, ['1','2','3','4','5','6'])
+ diffthis
+
+ new two
+ call setline(1, ['2','4','5'])
+ diffthis
+
+ 1
+ norm dp]c
+ norm dp]c
+ wincmd w
+ call assert_equal(4, line('$'))
+ norm G
+ norm do
+ call assert_equal(3, line('$'))
+
+ windo diffoff
+ %bwipe!
+endfunc
+
func Test_diffoff()
enew!
call setline(1, ['Two', 'Three'])