aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/diff.c
diff options
context:
space:
mode:
authorJames McCoy <jamessan@jamessan.com>2017-02-10 10:10:09 -0500
committerGitHub <noreply@github.com>2017-02-10 10:10:09 -0500
commitbc33df245371136d46eb198748ef7d718e0a7ed1 (patch)
tree82ca00d4834286621288b6e6487bf3a52156094b /src/nvim/diff.c
parent7ed1422521eeebdd57bc79a55f4385767976a9f2 (diff)
parent67eae935575b85719f3292d428d9d5387e0d7fb8 (diff)
downloadrneovim-bc33df245371136d46eb198748ef7d718e0a7ed1.tar.gz
rneovim-bc33df245371136d46eb198748ef7d718e0a7ed1.tar.bz2
rneovim-bc33df245371136d46eb198748ef7d718e0a7ed1.zip
Merge pull request #6076 from lonerover/vim-7.4.2275
vim-patch: 7.4.2275,7.4.2279
Diffstat (limited to 'src/nvim/diff.c')
-rw-r--r--src/nvim/diff.c16
1 files changed, 13 insertions, 3 deletions
diff --git a/src/nvim/diff.c b/src/nvim/diff.c
index aafd50687e..5940dc55da 100644
--- a/src/nvim/diff.c
+++ b/src/nvim/diff.c
@@ -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);
}
}
}
@@ -1154,10 +1161,13 @@ void ex_diffoff(exarg_T *eap)
}
foldUpdateAll(wp);
-
- // make sure topline is not halfway through a fold
- changed_window_setting_win(wp);
}
+ // remove filler lines
+ wp->w_topfill = 0;
+
+ // make sure topline is not halfway a fold and cursor is
+ // invalidated
+ changed_window_setting_win(wp);
// Note: 'sbo' is not restored, it's a global option.
diff_buf_adjust(wp);