mirror of
https://github.com/neovim/neovim.git
synced 2025-10-09 19:36:40 +00:00
vim-patch:7.4.2279
Problem: Starting diff mode with the cursor in the last line might end up
only showing one closed fold. (John Beckett)
Solution: Scroll the window to show the same relative cursor position.
46328f9a1c
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user