Skip to content

Commit ac15324

Browse files
committed
Merge remote-tracking branch 'vim/master'
2 parents 2a07605 + 8def26a commit ac15324

File tree

7 files changed

+36
-21
lines changed

7 files changed

+36
-21
lines changed

src/auto/configure

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9602,10 +9602,10 @@ fi
96029602

96039603

96049604

9605-
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for CYGWIN environment" >&5
9606-
$as_echo_n "checking for CYGWIN environment... " >&6; }
9605+
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for CYGWIN or MSYS environment" >&5
9606+
$as_echo_n "checking for CYGWIN or MSYS environment... " >&6; }
96079607
case `uname` in
9608-
CYGWIN*) CYGWIN=yes; { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
9608+
CYGWIN*|MSYS*) CYGWIN=yes; { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
96099609
$as_echo "yes" >&6; }
96109610
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for CYGWIN clipboard support" >&5
96119611
$as_echo_n "checking for CYGWIN clipboard support... " >&6; }

src/configure.in

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2861,9 +2861,9 @@ dnl end of GUI-checking
28612861
dnl ---------------------------------------------------------------------------
28622862

28632863
dnl Check for Cygwin, which needs an extra source file if not using X11
2864-
AC_MSG_CHECKING(for CYGWIN environment)
2864+
AC_MSG_CHECKING(for CYGWIN or MSYS environment)
28652865
case `uname` in
2866-
CYGWIN*) CYGWIN=yes; AC_MSG_RESULT(yes)
2866+
CYGWIN*|MSYS*) CYGWIN=yes; AC_MSG_RESULT(yes)
28672867
AC_MSG_CHECKING(for CYGWIN clipboard support)
28682868
if test "x$with_x" = "xno" ; then
28692869
OS_EXTRA_SRC=winclip.c; OS_EXTRA_OBJ=objects/winclip.o

src/diff.c

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1087,6 +1087,7 @@ ex_diffsplit(eap)
10871087
exarg_T *eap;
10881088
{
10891089
win_T *old_curwin = curwin;
1090+
buf_T *old_curbuf = curbuf;
10901091

10911092
#ifdef FEAT_GUI
10921093
need_mouse_correct = TRUE;
@@ -1105,7 +1106,18 @@ ex_diffsplit(eap)
11051106
{
11061107
/* Set 'diff', 'scrollbind' on and 'wrap' off. */
11071108
diff_win_options(curwin, TRUE);
1108-
diff_win_options(old_curwin, TRUE);
1109+
if (win_valid(old_curwin))
1110+
{
1111+
diff_win_options(old_curwin, TRUE);
1112+
1113+
if (buf_valid(old_curbuf))
1114+
/* Move the cursor position to that of the old window. */
1115+
curwin->w_cursor.lnum = diff_get_corresponding_line(
1116+
old_curbuf,
1117+
old_curwin->w_cursor.lnum,
1118+
curbuf,
1119+
curwin->w_cursor.lnum);
1120+
}
11091121
}
11101122
}
11111123
}
@@ -2541,7 +2553,6 @@ diff_move_to(dir, count)
25412553
return OK;
25422554
}
25432555

2544-
#if defined(FEAT_CURSORBIND) || defined(PROTO)
25452556
linenr_T
25462557
diff_get_corresponding_line(buf1, lnum1, buf2, lnum3)
25472558
buf_T *buf1;
@@ -2610,7 +2621,6 @@ diff_get_corresponding_line(buf1, lnum1, buf2, lnum3)
26102621

26112622
return lnum2;
26122623
}
2613-
#endif
26142624

26152625
#if defined(FEAT_FOLDING) || defined(PROTO)
26162626
/*

src/ex_cmds.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -540,10 +540,11 @@ ex_sort(eap)
540540
if (!unique || i == 0
541541
|| (sort_ic ? STRICMP(s, sortbuf1) : STRCMP(s, sortbuf1)) != 0)
542542
{
543-
if (ml_append(lnum++, s, (colnr_T)0, FALSE) == FAIL)
543+
/* Copy the line into a buffer, it may become invalid in
544+
* ml_append(). And it's needed for "unique". */
545+
STRCPY(sortbuf1, s);
546+
if (ml_append(lnum++, sortbuf1, (colnr_T)0, FALSE) == FAIL)
544547
break;
545-
if (unique)
546-
STRCPY(sortbuf1, s);
547548
}
548549
fast_breakcheck();
549550
if (got_int)

src/ex_getln.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3079,12 +3079,12 @@ restore_cmdline_alloc(p)
30793079
#endif
30803080

30813081
/*
3082-
* paste a yank register into the command line.
3083-
* used by CTRL-R command in command-line mode
3082+
* Paste a yank register into the command line.
3083+
* Used by CTRL-R command in command-line mode.
30843084
* insert_reg() can't be used here, because special characters from the
30853085
* register contents will be interpreted as commands.
30863086
*
3087-
* return FAIL for failure, OK otherwise
3087+
* Return FAIL for failure, OK otherwise.
30883088
*/
30893089
static int
30903090
cmdline_paste(regname, literally, remcr)

src/ops.c

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1577,7 +1577,7 @@ get_spec_reg(regname, argp, allocated, errmsg)
15771577
cmdline_paste_reg(regname, literally, remcr)
15781578
int regname;
15791579
int literally; /* Insert text literally instead of "as typed" */
1580-
int remcr; /* don't add trailing CR */
1580+
int remcr; /* don't add CR characters */
15811581
{
15821582
long i;
15831583

@@ -1590,12 +1590,8 @@ cmdline_paste_reg(regname, literally, remcr)
15901590
cmdline_paste_str(y_current->y_array[i], literally);
15911591

15921592
/* Insert ^M between lines and after last line if type is MLINE.
1593-
* Don't do this when "remcr" is TRUE and the next line is empty. */
1594-
if (y_current->y_type == MLINE
1595-
|| (i < y_current->y_size - 1
1596-
&& !(remcr
1597-
&& i == y_current->y_size - 2
1598-
&& *y_current->y_array[i + 1] == NUL)))
1593+
* Don't do this when "remcr" is TRUE. */
1594+
if ((y_current->y_type == MLINE || i < y_current->y_size - 1) && !remcr)
15991595
cmdline_paste_str((char_u *)"\r", literally);
16001596

16011597
/* Check for CTRL-C, in case someone tries to paste a few thousand

src/version.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -756,6 +756,14 @@ static char *(features[]) =
756756

757757
static int included_patches[] =
758758
{ /* Add new patch number below this line */
759+
/**/
760+
976,
761+
/**/
762+
975,
763+
/**/
764+
974,
765+
/**/
766+
973,
759767
/**/
760768
972,
761769
/**/

0 commit comments

Comments
 (0)