0
0
mirror of https://github.com/vim/vim.git synced 2025-09-24 03:44:06 -04:00

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.
This commit is contained in:
Bram Moolenaar
2016-08-28 15:39:57 +02:00
parent 4427db9bb2
commit 46328f9a1c
4 changed files with 20 additions and 2 deletions

View File

@@ -1075,6 +1075,10 @@ ex_diffsplit(exarg_T *eap)
#ifdef FEAT_GUI
need_mouse_correct = TRUE;
#endif
/* 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;
@@ -1101,6 +1105,9 @@ ex_diffsplit(exarg_T *eap)
curbuf,
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);
}
}
}