mirror of
https://github.com/neovim/neovim.git
synced 2025-10-01 15:38:33 +00:00
Merge pull request #4230 from jbradaric/vim-7.4.853
vim-patch:7.4.{853,856}
This commit is contained in:
@@ -1288,9 +1288,10 @@ void scroll_cursor_top(int min_scroll, int always)
|
||||
* - at least 'scrolloff' lines above and below the cursor
|
||||
*/
|
||||
validate_cheight();
|
||||
int used = curwin->w_cline_height;
|
||||
if (curwin->w_cursor.lnum < curwin->w_topline)
|
||||
int used = curwin->w_cline_height; // includes filler lines above
|
||||
if (curwin->w_cursor.lnum < curwin->w_topline) {
|
||||
scrolled = used;
|
||||
}
|
||||
|
||||
if (hasFolding(curwin->w_cursor.lnum, &top, &bot)) {
|
||||
--top;
|
||||
@@ -1301,9 +1302,10 @@ void scroll_cursor_top(int min_scroll, int always)
|
||||
}
|
||||
new_topline = top + 1;
|
||||
|
||||
/* count filler lines of the cursor window as context */
|
||||
// "used" already contains the number of filler lines above, don't add it
|
||||
// again.
|
||||
// Hide filler lines above cursor line by adding them to "extra".
|
||||
int extra = diff_check_fill(curwin, curwin->w_cursor.lnum);
|
||||
used += extra;
|
||||
|
||||
/*
|
||||
* Check if the lines from "top" to "bot" fit in the window. If they do,
|
||||
@@ -1312,7 +1314,7 @@ void scroll_cursor_top(int min_scroll, int always)
|
||||
while (top > 0) {
|
||||
int i = hasFolding(top, &top, NULL)
|
||||
? 1 // count one logical line for a sequence of folded lines
|
||||
: plines(top);
|
||||
: plines_nofill(top);
|
||||
used += i;
|
||||
if (extra + i <= off && bot < curbuf->b_ml.ml_line_count) {
|
||||
if (hasFolding(bot, NULL, &bot))
|
||||
|
@@ -432,10 +432,10 @@ static int included_patches[] = {
|
||||
// 859,
|
||||
858,
|
||||
// 857,
|
||||
// 856,
|
||||
856,
|
||||
// 855 NA
|
||||
// 854 NA
|
||||
// 853,
|
||||
853,
|
||||
// 852 NA
|
||||
// 851 NA
|
||||
// 850 NA
|
||||
|
Reference in New Issue
Block a user