Skip to content

Commit 7b3e0ab

Browse files
committed
Merge remote-tracking branch 'vim/master'
2 parents 3616c83 + 9cea87c commit 7b3e0ab

17 files changed

Lines changed: 212 additions & 59 deletions

src/Make_cyg_ming.mak

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,9 @@ FEATURES=HUGE
3535
# set to yes for a debug build
3636
DEBUG=no
3737

38+
# set to yes to create a mapfile
39+
# MAP=yes
40+
3841
# set to SIZE for size, SPEED for speed, MAXSPEED for maximum optimization
3942
OPTIMIZE=MAXSPEED
4043

@@ -244,6 +247,8 @@ endif
244247

245248
# Lua interface:
246249
# LUA=[Path to Lua directory] (Set inside Make_cyg.mak or Make_ming.mak)
250+
# LUA_LIBDIR=[Path to Lua library directory] (default: $LUA/lib)
251+
# LUA_INCDIR=[Path to Lua include directory] (default: $LUA/include)
247252
# DYNAMIC_LUA=yes (to load the Lua DLL dynamically)
248253
# LUA_VER=[Lua version, eg 51, 52] (default is 53)
249254
ifdef LUA
@@ -256,7 +261,8 @@ LUA_VER=53
256261
endif
257262

258263
ifeq (no,$(DYNAMIC_LUA))
259-
LUA_LIB = -L$(LUA)/lib -llua
264+
LUA_LIBDIR = $(LUA)/lib
265+
LUA_LIB = -L$(LUA_LIBDIR) -llua
260266
endif
261267

262268
endif
@@ -472,9 +478,10 @@ ifeq (19, $(word 1,$(sort 19 $(RUBY_VER))))
472478
RUBY_19_OR_LATER = 1
473479
endif
474480

475-
RUBYINC = -I $(RUBY)/lib/ruby/$(RUBY_API_VER_LONG)/$(RUBY_PLATFORM)
476481
ifdef RUBY_19_OR_LATER
477-
RUBYINC += -I $(RUBY)/include/ruby-$(RUBY_API_VER_LONG) -I $(RUBY)/include/ruby-$(RUBY_API_VER_LONG)/$(RUBY_PLATFORM)
482+
RUBYINC = -I $(RUBY)/include/ruby-$(RUBY_API_VER_LONG) -I $(RUBY)/include/ruby-$(RUBY_API_VER_LONG)/$(RUBY_PLATFORM)
483+
else
484+
RUBYINC = -I $(RUBY)/lib/ruby/$(RUBY_API_VER_LONG)/$(RUBY_PLATFORM)
478485
endif
479486
ifeq (no, $(DYNAMIC_RUBY))
480487
RUBYLIB = -L$(RUBY)/lib -l$(RUBY_INSTALL_NAME)
@@ -524,7 +531,8 @@ endif
524531
endif
525532

526533
ifdef LUA
527-
CFLAGS += -I$(LUA)/include -I$(LUA) -DFEAT_LUA
534+
LUA_INCDIR = $(LUA)/include
535+
CFLAGS += -I$(LUA_INCDIR) -I$(LUA) -DFEAT_LUA
528536
ifeq (yes, $(DYNAMIC_LUA))
529537
CFLAGS += -DDYNAMIC_LUA -DDYNAMIC_LUA_DLL=\"lua$(LUA_VER).dll\"
530538
endif
@@ -931,6 +939,10 @@ ifeq (yes, $(STATIC_WINPTHREAD))
931939
LIB += -Wl,-Bstatic -lwinpthread -Wl,-Bdynamic
932940
endif
933941

942+
ifeq (yes, $(MAP))
943+
LFLAGS += -Wl,-Map=$(TARGET).map
944+
endif
945+
934946
all: $(TARGET) vimrun.exe xxd/xxd.exe install.exe uninstal.exe GvimExt/gvimext.dll
935947

936948
vimrun.exe: vimrun.c

src/Make_mvc.mak

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1136,7 +1136,7 @@ RUBY_INSTALL_NAME = mswin32-ruby$(RUBY_API_VER)
11361136
CFLAGS = $(CFLAGS) -DFEAT_RUBY
11371137
RUBY_OBJ = $(OUTDIR)\if_ruby.obj
11381138
!if $(RUBY_VER) >= 19
1139-
RUBY_INC = /I "$(RUBY)\lib\ruby\$(RUBY_API_VER_LONG)\$(RUBY_PLATFORM)" /I "$(RUBY)\include\ruby-$(RUBY_API_VER_LONG)" /I "$(RUBY)\include\ruby-$(RUBY_API_VER_LONG)\$(RUBY_PLATFORM)"
1139+
RUBY_INC = /I "$(RUBY)\include\ruby-$(RUBY_API_VER_LONG)" /I "$(RUBY)\include\ruby-$(RUBY_API_VER_LONG)\$(RUBY_PLATFORM)"
11401140
!else
11411141
RUBY_INC = /I "$(RUBY)\lib\ruby\$(RUBY_API_VER_LONG)\$(RUBY_PLATFORM)"
11421142
!endif

src/Makefile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2045,8 +2045,9 @@ proto: $(PRO_AUTO) $(PRO_MANUAL)
20452045
# them as a list of individual flags.
20462046
# The -E"gcc -E" argument must be separate to avoid problems with shell
20472047
# quoting.
2048+
# Strip -O2, it may cause cproto to write stderr to the file "2".
20482049
CPROTO = cproto $(PROTO_FLAGS) -DPROTO \
2049-
`echo '$(LINT_CFLAGS)' | sed -e 's/ -[a-z-]\+//g'`
2050+
`echo '$(LINT_CFLAGS)' | sed -e 's/ -[a-z-]\+//g' -e 's/ -O[^ ]\+//g'`
20502051

20512052
### Would be nice if this would work for "normal" make.
20522053
### Currently it only works for (Free)BSD make.

src/buffer.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -428,7 +428,10 @@ can_unload_buffer(buf_T *buf)
428428

429429
FOR_ALL_WINDOWS(wp)
430430
if (wp->w_buffer == buf)
431+
{
431432
can_unload = FALSE;
433+
break;
434+
}
432435
}
433436
if (!can_unload)
434437
EMSG(_("E937: Attempt to delete a buffer that is in use"));
@@ -1746,6 +1749,9 @@ enter_buffer(buf_T *buf)
17461749
/* mark cursor position as being invalid */
17471750
curwin->w_valid = 0;
17481751

1752+
buflist_setfpos(curbuf, curwin, curbuf->b_last_cursor.lnum,
1753+
curbuf->b_last_cursor.col, TRUE);
1754+
17491755
/* Make sure the buffer is loaded. */
17501756
if (curbuf->b_ml.ml_mfp == NULL) /* need to load the file */
17511757
{

src/ex_cmds.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -649,7 +649,10 @@ ex_sort(exarg_T *eap)
649649
/* Adjust marks for deleted (or added) lines and prepare for displaying. */
650650
deleted = (long)(count - (lnum - eap->line2));
651651
if (deleted > 0)
652+
{
652653
mark_adjust(eap->line2 - deleted, eap->line2, (long)MAXLNUM, -deleted);
654+
msgmore(-deleted);
655+
}
653656
else if (deleted < 0)
654657
mark_adjust(eap->line2, MAXLNUM, -deleted, 0L);
655658

src/if_perl.xs

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -88,17 +88,23 @@
8888
# endif
8989
#endif
9090

91-
/* Perl compatibility stuff. This should ensure compatibility with older
92-
* versions of Perl.
93-
*/
94-
91+
// Perl compatibility stuff. This should ensure compatibility with older
92+
// versions of Perl.
9593
#ifndef PERL_VERSION
9694
# include <patchlevel.h>
9795
# define PERL_REVISION 5
9896
# define PERL_VERSION PATCHLEVEL
9997
# define PERL_SUBVERSION SUBVERSION
10098
#endif
10199

100+
101+
// Work around for ActivePerl 5.20.3+: Avoid generating (g)vim.lib.
102+
#if defined(ACTIVEPERL_VERSION) && (ACTIVEPERL_VERSION >= 2003) \
103+
&& defined(WIN32) && defined(USE_DYNAMIC_LOADING)
104+
# undef XS_EXTERNAL
105+
# define XS_EXTERNAL(name) XSPROTO(name)
106+
#endif
107+
102108
/*
103109
* Quoting Jan Dubois of Active State:
104110
* ActivePerl build 822 still identifies itself as 5.8.8 but already

src/memfile.c

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -539,9 +539,6 @@ mf_sync(memfile_T *mfp, int flags)
539539
{
540540
int status;
541541
bhdr_T *hp;
542-
#if defined(SYNC_DUP_CLOSE)
543-
int fd;
544-
#endif
545542
int got_int_save = got_int;
546543

547544
if (mfp->mf_fd < 0) /* there is no file, nothing to do */
@@ -624,13 +621,9 @@ mf_sync(memfile_T *mfp, int flags)
624621
status = FAIL;
625622
}
626623
#endif
627-
#ifdef SYNC_DUP_CLOSE
628-
/*
629-
* Win32 is a bit more work: Duplicate the file handle and close it.
630-
* This should flush the file to disk.
631-
*/
632-
if ((fd = dup(mfp->mf_fd)) >= 0)
633-
close(fd);
624+
#ifdef WIN32
625+
if (_commit(mfp->mf_fd))
626+
status = FAIL;
634627
#endif
635628
#ifdef AMIGA
636629
# if defined(__AROS__) || defined(__amigaos4__)

src/option.c

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4463,7 +4463,9 @@ trigger_optionsset_string(
44634463
char_u *oldval,
44644464
char_u *newval)
44654465
{
4466-
if (oldval != NULL && newval != NULL)
4466+
// Don't do this recursively.
4467+
if (oldval != NULL && newval != NULL
4468+
&& *get_vim_var_str(VV_OPTION_TYPE) == NUL)
44674469
{
44684470
char_u buf_type[7];
44694471

@@ -7906,8 +7908,6 @@ did_set_string_option(
79067908
#if defined(FEAT_VTP) && defined(FEAT_TERMGUICOLORS)
79077909
if (did_swaptcap)
79087910
{
7909-
if (t_colors < 256)
7910-
p_tgc = 0;
79117911
set_termname((char_u *)"win32");
79127912
init_highlight(TRUE, FALSE);
79137913
}
@@ -9029,9 +9029,11 @@ set_bool_option(
90299029
options[opt_idx].flags |= P_WAS_SET;
90309030

90319031
#if defined(FEAT_EVAL)
9032-
if (!starting)
9032+
// Don't do this while starting up or recursively.
9033+
if (!starting && *get_vim_var_str(VV_OPTION_TYPE) == NUL)
90339034
{
90349035
char_u buf_old[2], buf_new[2], buf_type[7];
9036+
90359037
vim_snprintf((char *)buf_old, 2, "%d", old_value ? TRUE: FALSE);
90369038
vim_snprintf((char *)buf_new, 2, "%d", value ? TRUE: FALSE);
90379039
vim_snprintf((char *)buf_type, 7, "%s", (opt_flags & OPT_LOCAL) ? "local" : "global");
@@ -9625,7 +9627,8 @@ set_num_option(
96259627
options[opt_idx].flags |= P_WAS_SET;
96269628

96279629
#if defined(FEAT_EVAL)
9628-
if (!starting && errmsg == NULL)
9630+
// Don't do this while starting up, failure or recursively.
9631+
if (!starting && errmsg == NULL && *get_vim_var_str(VV_OPTION_TYPE) == NUL)
96299632
{
96309633
char_u buf_old[11], buf_new[11], buf_type[7];
96319634
vim_snprintf((char *)buf_old, 10, "%ld", old_value);

src/os_mac.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,6 @@
101101
#define HAVE_AVAIL_MEM
102102

103103
#ifndef HAVE_CONFIG_H
104-
/* #define SYNC_DUP_CLOSE sync() a file with dup() and close() */
105104
# define HAVE_STRING_H
106105
# define HAVE_STRCSPN
107106
# define HAVE_MEMSET

src/os_win32.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@
2626

2727
#define BINARY_FILE_IO
2828
#define USE_EXE_NAME /* use argv[0] for $VIM */
29-
#define SYNC_DUP_CLOSE /* sync() a file with dup() and close() */
3029
#define USE_TERM_CONSOLE
3130
#ifndef HAVE_STRING_H
3231
# define HAVE_STRING_H

0 commit comments

Comments
 (0)