aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJustin M. Keyes <justinkz@gmail.com>2016-02-17 04:08:57 -0500
committerJustin M. Keyes <justinkz@gmail.com>2016-02-17 04:08:57 -0500
commitaf1745a7639267efee0365e87495de61a99846f5 (patch)
tree6a311ecbd371dbf07f9111cf2ce23f04bad05182
parent9198b06ea67973905f2d6cbaadd56b1c21a64373 (diff)
parent313c24a31b7b6c670eb1eb1d98a0d6c9f584d273 (diff)
downloadrneovim-af1745a7639267efee0365e87495de61a99846f5.tar.gz
rneovim-af1745a7639267efee0365e87495de61a99846f5.tar.bz2
rneovim-af1745a7639267efee0365e87495de61a99846f5.zip
Merge pull request #4230 from jbradaric/vim-7.4.853
vim-patch:7.4.{853,856}
-rw-r--r--src/nvim/move.c12
-rw-r--r--src/nvim/version.c4
2 files changed, 9 insertions, 7 deletions
diff --git a/src/nvim/move.c b/src/nvim/move.c
index eb55397511..ba79c0411a 100644
--- a/src/nvim/move.c
+++ b/src/nvim/move.c
@@ -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))
diff --git a/src/nvim/version.c b/src/nvim/version.c
index 2d241204a6..ff00aaefba 100644
--- a/src/nvim/version.c
+++ b/src/nvim/version.c
@@ -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