mirror of
https://github.com/vim/vim.git
synced 2025-07-26 11:04:33 -04:00
patch 7.4.974
Problem: When using :diffsplit the cursor jumps to the first line. Solution: Put the cursor on the line related to where the cursor was before the split.
This commit is contained in:
parent
6f62fed349
commit
f29a82dcd0
16
src/diff.c
16
src/diff.c
@ -1087,6 +1087,7 @@ ex_diffsplit(eap)
|
|||||||
exarg_T *eap;
|
exarg_T *eap;
|
||||||
{
|
{
|
||||||
win_T *old_curwin = curwin;
|
win_T *old_curwin = curwin;
|
||||||
|
buf_T *old_curbuf = curbuf;
|
||||||
|
|
||||||
#ifdef FEAT_GUI
|
#ifdef FEAT_GUI
|
||||||
need_mouse_correct = TRUE;
|
need_mouse_correct = TRUE;
|
||||||
@ -1105,7 +1106,18 @@ ex_diffsplit(eap)
|
|||||||
{
|
{
|
||||||
/* Set 'diff', 'scrollbind' on and 'wrap' off. */
|
/* Set 'diff', 'scrollbind' on and 'wrap' off. */
|
||||||
diff_win_options(curwin, TRUE);
|
diff_win_options(curwin, TRUE);
|
||||||
diff_win_options(old_curwin, TRUE);
|
if (win_valid(old_curwin))
|
||||||
|
{
|
||||||
|
diff_win_options(old_curwin, TRUE);
|
||||||
|
|
||||||
|
if (buf_valid(old_curbuf))
|
||||||
|
/* Move the cursor position to that of the old window. */
|
||||||
|
curwin->w_cursor.lnum = diff_get_corresponding_line(
|
||||||
|
old_curbuf,
|
||||||
|
old_curwin->w_cursor.lnum,
|
||||||
|
curbuf,
|
||||||
|
curwin->w_cursor.lnum);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -2541,7 +2553,6 @@ diff_move_to(dir, count)
|
|||||||
return OK;
|
return OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined(FEAT_CURSORBIND) || defined(PROTO)
|
|
||||||
linenr_T
|
linenr_T
|
||||||
diff_get_corresponding_line(buf1, lnum1, buf2, lnum3)
|
diff_get_corresponding_line(buf1, lnum1, buf2, lnum3)
|
||||||
buf_T *buf1;
|
buf_T *buf1;
|
||||||
@ -2610,7 +2621,6 @@ diff_get_corresponding_line(buf1, lnum1, buf2, lnum3)
|
|||||||
|
|
||||||
return lnum2;
|
return lnum2;
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
#if defined(FEAT_FOLDING) || defined(PROTO)
|
#if defined(FEAT_FOLDING) || defined(PROTO)
|
||||||
/*
|
/*
|
||||||
|
@ -741,6 +741,8 @@ static char *(features[]) =
|
|||||||
|
|
||||||
static int included_patches[] =
|
static int included_patches[] =
|
||||||
{ /* Add new patch number below this line */
|
{ /* Add new patch number below this line */
|
||||||
|
/**/
|
||||||
|
974,
|
||||||
/**/
|
/**/
|
||||||
973,
|
973,
|
||||||
/**/
|
/**/
|
||||||
|
Loading…
x
Reference in New Issue
Block a user