vim-patch:7.4.2279

Problem:    Starting diff mode with the cursor in the last line might end up
            only showing one closed fold. (John Beckett)
Solution:   Scroll the window to show the same relative cursor position.

46328f9a1c
This commit is contained in:
lonerover
2017-02-07 15:48:01 +08:00
parent 7629176fb1
commit 67eae93557
3 changed files with 17 additions and 3 deletions

View File

@@ -1007,6 +1007,10 @@ void ex_diffsplit(exarg_T *eap)
bufref_T old_curbuf;
set_bufref(&old_curbuf, curbuf);
// Need to compute w_fraction when no redraw happened yet.
validate_cursor();
set_fraction(curwin);
// don't use a new tab page, each tab page has its own diffs
cmdmod.tab = 0;
@@ -1032,6 +1036,9 @@ void ex_diffsplit(exarg_T *eap)
curwin->w_cursor.lnum);
}
}
// Now that lines are folded scroll to show the cursor at the same
// relative position.
scroll_to_fraction(curwin, curwin->w_height);
}
}
}