vim-patch:7.4.856

Problem:    "zt" still doesn't work well with filler lines. (Gary Johnson)
Solution:   Check for filler lines above the cursor. (Christian Brabandt)

a09a2c5857
This commit is contained in:
Jurica Bradaric
2016-02-09 23:55:51 +01:00
parent 37288e522a
commit 313c24a31b
2 changed files with 5 additions and 8 deletions

View File

@@ -1302,13 +1302,10 @@ void scroll_cursor_top(int min_scroll, int always)
} }
new_topline = top + 1; new_topline = top + 1;
// used already contains the number of filler lines above, don't add it // "used" already contains the number of filler lines above, don't add it
// again. // again.
// TODO: if filler lines above new top are to be considered as context for // Hide filler lines above cursor line by adding them to "extra".
// the current window, leave next statement commented, else hide filler int extra = diff_check_fill(curwin, curwin->w_cursor.lnum);
// lines above cursor line, by adding them to extra
// int extra += diff_check_fill(curwin, curwin->w_cursor.lnum);
int extra = 0;
/* /*
* Check if the lines from "top" to "bot" fit in the window. If they do, * Check if the lines from "top" to "bot" fit in the window. If they do,
@@ -1317,7 +1314,7 @@ void scroll_cursor_top(int min_scroll, int always)
while (top > 0) { while (top > 0) {
int i = hasFolding(top, &top, NULL) int i = hasFolding(top, &top, NULL)
? 1 // count one logical line for a sequence of folded lines ? 1 // count one logical line for a sequence of folded lines
: plines(top); : plines_nofill(top);
used += i; used += i;
if (extra + i <= off && bot < curbuf->b_ml.ml_line_count) { if (extra + i <= off && bot < curbuf->b_ml.ml_line_count) {
if (hasFolding(bot, NULL, &bot)) if (hasFolding(bot, NULL, &bot))

View File

@@ -432,7 +432,7 @@ static int included_patches[] = {
// 859, // 859,
858, 858,
// 857, // 857,
// 856, 856,
// 855 NA // 855 NA
// 854 NA // 854 NA
853, 853,