aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/diff.c
diff options
context:
space:
mode:
authorMarco Hinz <mh.codebro@gmail.com>2017-01-09 14:35:04 +0100
committerJames McCoy <jamessan@jamessan.com>2017-02-04 17:55:46 -0500
commitc05e7f0fdd15d550cfb1054416a08d4514a4fb7e (patch)
treeac051f64de7006efe1463da9e549e7c507817683 /src/nvim/diff.c
parente3b92c77da0277c8d58e037e42c5b929be469284 (diff)
downloadrneovim-c05e7f0fdd15d550cfb1054416a08d4514a4fb7e.tar.gz
rneovim-c05e7f0fdd15d550cfb1054416a08d4514a4fb7e.tar.bz2
rneovim-c05e7f0fdd15d550cfb1054416a08d4514a4fb7e.zip
vim-patch:7.4.2024
Problem: More buf_valid() calls can be optimized. Solution: Use bufref_valid() instead. NOTE: Some changes related to channels and the Python and Netbeans interfaces were obviously left out. https://github.com/vim/vim/commit/7c0a2f367f2507669560b1a66423155c70d2e75b
Diffstat (limited to 'src/nvim/diff.c')
-rw-r--r--src/nvim/diff.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/nvim/diff.c b/src/nvim/diff.c
index f7b96ba3e1..aafd50687e 100644
--- a/src/nvim/diff.c
+++ b/src/nvim/diff.c
@@ -1004,7 +1004,8 @@ theend:
void ex_diffsplit(exarg_T *eap)
{
win_T *old_curwin = curwin;
- buf_T *old_curbuf = curbuf;
+ bufref_T old_curbuf;
+ set_bufref(&old_curbuf, curbuf);
// don't use a new tab page, each tab page has its own diffs
cmdmod.tab = 0;
@@ -1022,10 +1023,10 @@ void ex_diffsplit(exarg_T *eap)
if (win_valid(old_curwin)) {
diff_win_options(old_curwin, true);
- if (buf_valid(old_curbuf)) {
+ if (bufref_valid(&old_curbuf)) {
// Move the cursor position to that of the old window.
curwin->w_cursor.lnum = diff_get_corresponding_line(
- old_curbuf,
+ old_curbuf.br_buf,
old_curwin->w_cursor.lnum,
curbuf,
curwin->w_cursor.lnum);