diff options
author | Bram Moolenaar <Bram@vim.org> | 2006-04-30 18:54:39 +0000 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2006-04-30 18:54:39 +0000 |
commit | c9b4b05b3544b434730eb218e848a1a441d5ffb2 (patch) | |
tree | c1550ddf398d2030ed25ee98e8342fcb41ac1c87 /src | |
parent | aa35dd1667c5903cdcc32ebe10f27bc6683c68a1 (diff) |
updated for version 7.0gv7.0g
Diffstat (limited to 'src')
57 files changed, 1415 insertions, 1329 deletions
diff --git a/src/GvimExt/GvimExt.reg b/src/GvimExt/GvimExt.reg index 1e3a78186a..bb906e26c4 100644 --- a/src/GvimExt/GvimExt.reg +++ b/src/GvimExt/GvimExt.reg @@ -15,6 +15,6 @@ REGEDIT4 [HKEY_LOCAL_MACHINE\Software\Vim\Gvim] "path"="gvim.exe" -[HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Uninstall\Vim 7.0f] - "DisplayName"="Vim 7.0f: Edit with Vim popup menu entry" +[HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Uninstall\Vim 7.0g] + "DisplayName"="Vim 7.0g: Edit with Vim popup menu entry" "UninstallString"="uninstal.exe" diff --git a/src/INSTALLmac.txt b/src/INSTALLmac.txt index fa40c157bd..81ad970fe8 100644 --- a/src/INSTALLmac.txt +++ b/src/INSTALLmac.txt @@ -43,9 +43,9 @@ MacOS Classic is no longer supported. If you really want it use Vim 6.4. To overrule the architecture do this before running make: - ./configure --with-mac-arch=intel + ./configure --with-mac-arch=intel or - ./configure --with-mac-arch=ppc + ./configure --with-mac-arch=ppc 1.2 X-Windows or Plain Text diff --git a/src/INSTALLpc.txt b/src/INSTALLpc.txt index d2a3e2835d..a13dce0596 100644 --- a/src/INSTALLpc.txt +++ b/src/INSTALLpc.txt @@ -43,11 +43,11 @@ To build Vim from the command line with MSVC, use Make_mvc.mak. Visual Studio installed a batch file called vcvars32.bat, which you must run to set up paths for nmake and MSVC. -nmake -f Make_mvc.mak console Win32 SDK or Microsoft Visual C++ -nmake -f Make_mvc.mak GUI=yes GUI Microsoft Visual C++ -nmake -f Make_mvc.mak OLE=yes OLE Microsoft Visual C++ +nmake -f Make_mvc.mak console Win32 SDK or Microsoft Visual C++ +nmake -f Make_mvc.mak GUI=yes GUI Microsoft Visual C++ +nmake -f Make_mvc.mak OLE=yes OLE Microsoft Visual C++ nmake -f Make_mvc.mak PERL=C:\Perl PYTHON=C:\Python etc. - Perl, Python, etc. + Perl, Python, etc. Make_mvc.mak allows a Vim to be built with various different features and debug support. Debugging with MS Devstudio is provided by Make_dvc.mak. @@ -61,9 +61,9 @@ To build Vim from within the Visual Studio IDE, open the Make_ivc.mak project. far more configuration.) Make_ivc.mak can also be built with nmake. nmake -f Make_ivc.mak CFG="Vim - Win32 Release gvim" - GUI Microsoft Visual C++ 4.x or later + GUI Microsoft Visual C++ 4.x or later nmake -f Make_ivc.mak CFG="Vim - Win32 Release gvim OLE" - OLE Microsoft Visual C++ 4.x or later + OLE Microsoft Visual C++ 4.x or later See the specific files for comments and options. @@ -94,7 +94,7 @@ free C compilers for Win32.) To compile Vim using the VC2003 Toolkit and Make_mvc.mak, you must first execute the following commands in a cmd.exe window (the msvcsetup.bat batch file can be used): - + set PATH=%SystemRoot%\Microsoft.NET\Framework\v1.1.4322;%PATH% call "%VCToolkitInstallDir%vcvars32.bat" set MSVCVer=7.1 @@ -104,7 +104,7 @@ file can be used): Now you can build Vim with Make_mvc.mak. -Getting the Windows Platform SDK *ms-platform-sdk* +Getting the Windows Platform SDK *ms-platform-sdk* You will also need a copy of the Windows Platform SDK from http://www.microsoft.com/msdownload/platformsdk/sdkupdate/ @@ -122,7 +122,7 @@ This is needed to install |dotnet-1.1-sdk|. It also contains cvtres.exe, which is needed to link Vim. -Getting the .NET Framework 1.1 SDK *dotnet-1.1-sdk* +Getting the .NET Framework 1.1 SDK *dotnet-1.1-sdk* You need the .NET Framework 1.1 SDK from http://www.microsoft.com/downloads/details.aspx?familyid=9b3a2ca6-3647-4070-9f41-a333c6b9181d @@ -131,7 +131,7 @@ such as msvcrt.lib. You must install |dotnet-1.1-redist| before installing the .NET 1.1 SDK. -Getting the WinDbg debugger *windbg-download* +Getting the WinDbg debugger *windbg-download* The Debugging Tools for Windows can be downloaded from http://www.microsoft.com/whdc/devtools/debugging/default.mspx @@ -242,7 +242,7 @@ Use Make_bc5.mak with Borland C++ 5.x. See If you like, you can compile the 'mingw' Win32 version from the comfort of your Linux (or other unix) box. To do this, you need to follow a few steps: 1) Install the mingw32 cross-compiler. See - http://www.libsdl.org/extras/win32/cross/README.txt + http://www.libsdl.org/extras/win32/cross/README.txt 2) get the *unix* version of the vim sources 3) in 'Make_ming.mak', set 'CROSS' to '1' instead of '0'. 4) make -f Make_ming.mak gvim.exe @@ -317,7 +317,7 @@ After a successful build, these dlls can be freely removed, leaving them in 8. Windows 3.1x =============== -make -f Make_w16.mak 16 bit, Borland C++ 5.0 +make -f Make_w16.mak 16 bit, Borland C++ 5.0 Warning: Be sure to use the right make.exe. It should be Borland make. @@ -340,9 +340,9 @@ In MSVC 4.2 support for Win32s was dropped! Use this command: Summary: ren Make_bc3.mak Makefile; make 16 bit, Borland C++ and Turbo C++ ren Make_tcc.mak Makefile; make 16 bit, Turbo C -make -f Make_djg.mak 32 bit, DJGPP 2.0 -make -f Make_bc5.mak 32 bit, Borland C++ 5.x (edit it to - define DOS) +make -f Make_djg.mak 32 bit, DJGPP 2.0 +make -f Make_bc5.mak 32 bit, Borland C++ 5.x (edit it to + define DOS) Warning: Be sure to use the right make.exe. Microsoft C make doesn't work; Borland make only works with Make_bc3.mak, Make_bc5.mak and Make_tcc.mak; diff --git a/src/INSTALLvms.txt b/src/INSTALLvms.txt index c0ce311843..512b6657f3 100644 --- a/src/INSTALLvms.txt +++ b/src/INSTALLvms.txt @@ -1,7 +1,7 @@ INSTALLvms.txt - Installation of Vim on OpenVMS Maintainer: Zoltan Arpadffy <arpadffy@polarhome.com> -Last change: 2006 Mar 02 +Last change: 2006 Apr 30 This file contains instructions for compiling Vim on Openvms. If you already have an executable version of Vim, you don't need this. @@ -303,7 +303,7 @@ perl_env : You need also the OpenVMS Porting Library: http://www.openvms.compaq.com/openvms/products/ips/porting.html - Source code for GTK and porting library that is used to build + Source code for GTK and porting library that is used to build VMS executables at polarhome.com are at http://www.polarhome.com/vim/files/source/vms/ diff --git a/src/Make_bc5.mak b/src/Make_bc5.mak index e50a435991..a1d92bdd3a 100644 --- a/src/Make_bc5.mak +++ b/src/Make_bc5.mak @@ -54,9 +54,9 @@ # RUBY_VER_LONG same, but in format with dot. (1.6) # DYNAMIC_RUBY no or yes: use yes to load the Ruby DLL dynamically (no) # MBYTE no or yes: set to yes for multi-byte support (yes) -# NOTE: multi-byte support is broken in the Borland libraries, -# not everything will work properly! Esp. handling multi-byte -# file names. +# NOTE: multi-byte support is broken in the Borland libraries, +# not everything will work properly! Esp. handling multi-byte +# file names. # IME no or yes: set to yes for multi-byte IME support (yes) # DYNAMIC_IME no or yes: set to yes to load imm32.dll dynamically (yes) # GETTEXT no or yes: set to yes for multi-language support (yes) @@ -80,7 +80,7 @@ # CSCOPE no or yes: include support for Cscope interface (yes) # NETBEANS no or yes: include support for Netbeans interface (yes if GUI # is yes) -# NBDEBUG no or yes: include support for debugging Netbeans interface (no) +# NBDEBUG no or yes: include support for debugging Netbeans interface (no) # XPM define to path to XPM dir to get support for loading XPM images. ### BOR: root of the BC installation diff --git a/src/Make_cyg.mak b/src/Make_cyg.mak index 556817429b..4c757e1b32 100644 --- a/src/Make_cyg.mak +++ b/src/Make_cyg.mak @@ -1,6 +1,6 @@ # # Makefile for VIM on Win32, using Cygnus gcc -# Last updated by Dan Sharp. Last Change: 2006 Mar 24 +# Last updated by Dan Sharp. Last Change: 2006 Apr 30 # # Also read INSTALLpc.txt! # @@ -42,7 +42,7 @@ # OPTIMIZE SPACE, SPEED, or MAXSPEED: set optimization level (MAXSPEED) # NETBEANS no or yes: to include netbeans interface support (yes when GUI # is yes) -# NBDEBUG no or yes: to include netbeans interface debugging support (no) +# NBDEBUG no or yes: to include netbeans interface debugging support (no) # XPM define to path to XPM dir to get XPM image support (not defined) #>>>>> choose options: ifndef GUI diff --git a/src/Make_vms.mms b/src/Make_vms.mms index 895b7bc98c..07d2b2042c 100644 --- a/src/Make_vms.mms +++ b/src/Make_vms.mms @@ -2,7 +2,7 @@ # Makefile for Vim on OpenVMS # # Maintainer: Zoltan Arpadffy <arpadffy@polarhome.com> -# Last change: 2006 Apr 11 +# Last change: 2006 Apr 30 # # This has script been tested on VMS 6.2 to 8.2 on DEC Alpha, VAX and IA64 # with MMS and MMK @@ -100,7 +100,7 @@ CCVER = YES .IFDEF VAX .IFDEF DECC # VAX with DECC CC_DEF = cc # /decc # some system requires this switch - # but when it is not required /ver might fail + # but when it is not required /ver might fail PREFIX = /prefix=all .ELSE # VAX with VAXC CC_DEF = cc @@ -391,7 +391,7 @@ motif_env : .IFDEF XPM -@ write sys$output "using DECW/Motif/XPM environment." .ELSE - -@ write sys$output "using DECW/Motif environment." + -@ write sys$output "using DECW/Motif environment." .ENDIF -@ write sys$output "creating OS_VMS_MOTIF.OPT file." -@ open/write opt_file OS_VMS_MOTIF.OPT diff --git a/src/Makefile b/src/Makefile index 85725511b3..32f3a97c62 100644 --- a/src/Makefile +++ b/src/Makefile @@ -880,7 +880,7 @@ MAN1DIR = /man1 ### Vim version (adjusted by a script) VIMMAJOR = 7 -VIMMINOR = 0f +VIMMINOR = 0g ### Location of Vim files (should not need to be changed, and {{{1 ### some things might not work when they are changed!) @@ -1113,7 +1113,7 @@ GTK_BUNDLE = ### Motif GUI MOTIF_SRC = gui.c gui_motif.c gui_x11.c pty.c gui_beval.c \ - gui_xmdlg.c gui_xmebw.c + gui_xmdlg.c gui_xmebw.c MOTIF_OBJ = objects/gui.o objects/gui_motif.o objects/gui_x11.o \ objects/pty.o objects/gui_beval.o \ objects/gui_xmdlg.o objects/gui_xmebw.o @@ -1764,7 +1764,7 @@ INSTALLMANARGS = $(VIMLOC) $(SCRIPTLOC) $(VIMRCLOC) $(HELPSOURCE) $(MANMOD) \ # Install most of the runtime files installruntime: installrtbase installmacros installtutor installspell - + # install the help files; first adjust the contents for the final location installrtbase: $(HELPSOURCE)/vim.1 $(DEST_VIM) $(DEST_RT) \ $(DEST_HELP) $(DEST_PRINT) $(DEST_COL) $(DEST_SYN) $(DEST_IND) \ @@ -2062,7 +2062,7 @@ INSTALLMLARGS = $(VIMNAME) $(VIMDIFFNAME) $(EVIMNAME) \ $(GVIMNAME) $(GVIEWNAME) $(RGVIMNAME) $(RGVIEWNAME) \ $(GVIMDIFFNAME) $(EVIEWNAME) -installmanlinks: +installmanlinks: -$(SHELL) ./installml.sh install "$(GUI_MAN_TARGETS)" \ $(DEST_MAN) $(INSTALLMLARGS) diff --git a/src/auto/configure b/src/auto/configure index 319fd4e5af..35eea3523f 100755 --- a/src/auto/configure +++ b/src/auto/configure @@ -2983,7 +2983,7 @@ sed 's/^/| /' conftest.$ac_ext >&5 echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 - MACARCH="ppc" + MACARCH="ppc" CPPFLAGS="$save_cppflags -arch ppc" LDFLAGS="$save_ldflags -arch ppc" fi @@ -3753,11 +3753,11 @@ echo $ECHO_N "checking PLTHOME environment var... $ECHO_C" >&6 if test "X$PLTHOME" != "X"; then echo "$as_me:$LINENO: result: \"$PLTHOME\"" >&5 echo "${ECHO_T}\"$PLTHOME\"" >&6 - vi_cv_path_mzscheme_pfx="$PLTHOME" + vi_cv_path_mzscheme_pfx="$PLTHOME" else echo "$as_me:$LINENO: result: \"not set\"" >&5 echo "${ECHO_T}\"not set\"" >&6 - # Extract the first word of "mzscheme", so it can be a program name with args. + # Extract the first word of "mzscheme", so it can be a program name with args. set dummy mzscheme; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 @@ -3797,30 +3797,30 @@ echo "${ECHO_T}no" >&6 fi - if test "X$vi_cv_path_mzscheme" != "X"; then + if test "X$vi_cv_path_mzscheme" != "X"; then lsout=`ls -l $vi_cv_path_mzscheme` if echo "$lsout" | grep -e '->' >/dev/null 2>/dev/null; then vi_cv_path_mzscheme=`echo "$lsout" | sed 's/.*-> \(.*\)/\1/'` fi fi - if test "X$vi_cv_path_mzscheme" != "X"; then - echo "$as_me:$LINENO: checking MzScheme install prefix" >&5 + if test "X$vi_cv_path_mzscheme" != "X"; then + echo "$as_me:$LINENO: checking MzScheme install prefix" >&5 echo $ECHO_N "checking MzScheme install prefix... $ECHO_C" >&6 if test "${vi_cv_path_mzscheme_pfx+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else vi_cv_path_mzscheme_pfx=` - ${vi_cv_path_mzscheme} -evm \ - "(display (simplify-path \ - (build-path (call-with-values \ - (lambda () (split-path (find-system-path (quote exec-file)))) \ - (lambda (base name must-be-dir?) base)) (quote up))))"` + ${vi_cv_path_mzscheme} -evm \ + "(display (simplify-path \ + (build-path (call-with-values \ + (lambda () (split-path (find-system-path (quote exec-file)))) \ + (lambda (base name must-be-dir?) base)) (quote up))))"` fi echo "$as_me:$LINENO: result: $vi_cv_path_mzscheme_pfx" >&5 echo "${ECHO_T}$vi_cv_path_mzscheme_pfx" >&6 vi_cv_path_mzscheme_pfx=`echo "$vi_cv_path_mzscheme_pfx" | sed 's+/$++'` - fi + fi fi fi @@ -3843,7 +3843,7 @@ echo "${ECHO_T}\"no\"" >&6 else MZSCHEME_LIBS="-L${vi_cv_path_mzscheme_pfx}/lib -lmzgc -lmzscheme" if test "$GCC" = yes; then - MZSCHEME_LIBS="$MZSCHEME_LIBS -Wl,-rpath -Wl,${vi_cv_path_mzscheme_pfx}/lib" + MZSCHEME_LIBS="$MZSCHEME_LIBS -Wl,-rpath -Wl,${vi_cv_path_mzscheme_pfx}/lib" elif test "`(uname) 2>/dev/null`" = SunOS && uname -r | grep '^5' >/dev/null; then MZSCHEME_LIBS="$MZSCHEME_LIBS -R ${vi_cv_path_mzscheme_pfx}/lib" @@ -7848,7 +7848,7 @@ echo $ECHO_N "checking for FreeBSD... $ECHO_C" >&6 if test "`(uname) 2>/dev/null`" = FreeBSD; then echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6 - GNOME_INCLUDEDIR="$GNOME_INCLUDEDIR -D_THREAD_SAFE" + GNOME_INCLUDEDIR="$GNOME_INCLUDEDIR -D_THREAD_SAFE" GNOME_LIBS="$GNOME_LIBS -pthread" else echo "$as_me:$LINENO: result: no" >&5 diff --git a/src/configure.in b/src/configure.in index 5c6dd516f7..9e500d94df 100644 --- a/src/configure.in +++ b/src/configure.in @@ -135,7 +135,7 @@ if test "`(uname) 2>/dev/null`" = Darwin; then AC_TRY_LINK([ ], [ ], AC_MSG_RESULT(yes); MACARCH="intel", AC_MSG_RESULT(no, using PowerPC) - MACARCH="ppc" + MACARCH="ppc" CPPFLAGS="$save_cppflags -arch ppc" LDFLAGS="$save_ldflags -arch ppc")) elif test "x$MACARCH" = "xintel"; then @@ -372,8 +372,8 @@ if test "$enable_mzschemeinterp" = "yes"; then AC_MSG_CHECKING(--with-plthome argument) AC_ARG_WITH(plthome, - [ --with-plthome=PLTHOME Use PLTHOME.], - with_plthome="$withval"; AC_MSG_RESULT($with_plthome), + [ --with-plthome=PLTHOME Use PLTHOME.], + with_plthome="$withval"; AC_MSG_RESULT($with_plthome), with_plthome="";AC_MSG_RESULT("no")) if test "X$with_plthome" != "X"; then @@ -382,33 +382,33 @@ if test "$enable_mzschemeinterp" = "yes"; then AC_MSG_CHECKING(PLTHOME environment var) if test "X$PLTHOME" != "X"; then AC_MSG_RESULT("$PLTHOME") - vi_cv_path_mzscheme_pfx="$PLTHOME" + vi_cv_path_mzscheme_pfx="$PLTHOME" else AC_MSG_RESULT("not set") dnl -- try to find MzScheme executable - AC_PATH_PROG(vi_cv_path_mzscheme, mzscheme) + AC_PATH_PROG(vi_cv_path_mzscheme, mzscheme) dnl resolve symbolic link, the executable is often elsewhere and there dnl are no links for the include files. - if test "X$vi_cv_path_mzscheme" != "X"; then + if test "X$vi_cv_path_mzscheme" != "X"; then lsout=`ls -l $vi_cv_path_mzscheme` if echo "$lsout" | grep -e '->' >/dev/null 2>/dev/null; then vi_cv_path_mzscheme=`echo "$lsout" | sed 's/.*-> \(.*\)/\1/'` fi fi - if test "X$vi_cv_path_mzscheme" != "X"; then - dnl -- find where MzScheme thinks it was installed - AC_CACHE_CHECK(MzScheme install prefix,vi_cv_path_mzscheme_pfx, - [ vi_cv_path_mzscheme_pfx=` - ${vi_cv_path_mzscheme} -evm \ - "(display (simplify-path \ - (build-path (call-with-values \ - (lambda () (split-path (find-system-path (quote exec-file)))) \ - (lambda (base name must-be-dir?) base)) (quote up))))"` ]) + if test "X$vi_cv_path_mzscheme" != "X"; then + dnl -- find where MzScheme thinks it was installed + AC_CACHE_CHECK(MzScheme install prefix,vi_cv_path_mzscheme_pfx, + [ vi_cv_path_mzscheme_pfx=` + ${vi_cv_path_mzscheme} -evm \ + "(display (simplify-path \ + (build-path (call-with-values \ + (lambda () (split-path (find-system-path (quote exec-file)))) \ + (lambda (base name must-be-dir?) base)) (quote up))))"` ]) dnl Remove a trailing slash. vi_cv_path_mzscheme_pfx=`echo "$vi_cv_path_mzscheme_pfx" | sed 's+/$++'` - fi + fi fi fi @@ -430,7 +430,7 @@ if test "$enable_mzschemeinterp" = "yes"; then if test "$GCC" = yes; then dnl Make Vim remember the path to the library. For when it's not in dnl $LD_LIBRARY_PATH. - MZSCHEME_LIBS="$MZSCHEME_LIBS -Wl,-rpath -Wl,${vi_cv_path_mzscheme_pfx}/lib" + MZSCHEME_LIBS="$MZSCHEME_LIBS -Wl,-rpath -Wl,${vi_cv_path_mzscheme_pfx}/lib" elif test "`(uname) 2>/dev/null`" = SunOS && uname -r | grep '^5' >/dev/null; then MZSCHEME_LIBS="$MZSCHEME_LIBS -R ${vi_cv_path_mzscheme_pfx}/lib" @@ -1486,13 +1486,13 @@ AC_DEFUN([GNOME_INIT_HOOK], GNOME_LIBS=`$PKG_CONFIG --libs-only-l libgnomeui-2.0` GNOME_LIBDIR=`$PKG_CONFIG --libs-only-L libgnomeui-2.0` GNOME_INCLUDEDIR=`$PKG_CONFIG --cflags libgnomeui-2.0` - + dnl On FreeBSD we need -pthread but pkg-config doesn't include it. dnl This might not be the right way but it works for me... AC_MSG_CHECKING(for FreeBSD) if test "`(uname) 2>/dev/null`" = FreeBSD; then AC_MSG_RESULT(yes, adding -pthread) - GNOME_INCLUDEDIR="$GNOME_INCLUDEDIR -D_THREAD_SAFE" + GNOME_INCLUDEDIR="$GNOME_INCLUDEDIR -D_THREAD_SAFE" GNOME_LIBS="$GNOME_LIBS -pthread" else AC_MSG_RESULT(no) diff --git a/src/eval.c b/src/eval.c index 388727f181..945b460b1e 100644 --- a/src/eval.c +++ b/src/eval.c @@ -198,7 +198,7 @@ struct ufunc */ static hashtab_T func_hashtab; -/* The names of packages that once were loaded is remembered. */ +/* The names of packages that once were loaded are remembered. */ static garray_T ga_loaded = {0, 0, sizeof(char_u *), 4, NULL}; /* list heads for garbage collection */ diff --git a/src/ex_docmd.c b/src/ex_docmd.c index 2fc5d0a94a..2f4766d6fc 100644 --- a/src/ex_docmd.c +++ b/src/ex_docmd.c @@ -8813,6 +8813,11 @@ ex_normal(eap) char_u *p; #endif + if (ex_normal_lock > 0) + { + EMSG(_(e_secure)); + return; + } if (ex_normal_busy >= p_mmd) { EMSG(_("E192: Recursive use of :normal too deep")); diff --git a/src/ex_getln.c b/src/ex_getln.c index 376cbcc493..3ac20ff85a 100644 --- a/src/ex_getln.c +++ b/src/ex_getln.c @@ -4325,7 +4325,7 @@ ExpandFromContext(xp, pat, num_file, file, options) return ExpandRTDir(pat, num_file, file, "compiler"); # if defined(FEAT_USR_CMDS) && defined(FEAT_EVAL) if (xp->xp_context == EXPAND_USER_LIST) - return ExpandUserList(xp, num_file, file); + return ExpandUserList(xp, num_file, file); # endif regmatch.regprog = vim_regcomp(pat, p_magic ? RE_MAGIC : 0); diff --git a/src/fileio.c b/src/fileio.c index 01953f381a..9f24f69436 100644 --- a/src/fileio.c +++ b/src/fileio.c @@ -7762,7 +7762,7 @@ do_autocmd_event(event, pat, nested, cmd, forceit, group) int findgroup; int allgroups; int patlen; - int is_buflocal; + int is_buflocal; int buflocal_nr; char_u buflocal_pat[25]; /* for "<buffer=X>" */ @@ -8839,10 +8839,10 @@ has_autocmd(event, sfname, buf) for (ap = first_autopat[(int)event]; ap != NULL; ap = ap->next) if (ap->pat != NULL && ap->cmds != NULL - && (ap->buflocal_nr == 0 + && (ap->buflocal_nr == 0 ? match_file_pat(NULL, ap->reg_prog, fname, sfname, tail, ap->allow_dirs) - : buf != NULL && ap->buflocal_nr == buf->b_fnum + : buf != NULL && ap->buflocal_nr == buf->b_fnum )) { retval = TRUE; diff --git a/src/getchar.c b/src/getchar.c index 3b9d42014b..88e724ff31 100644 --- a/src/getchar.c +++ b/src/getchar.c @@ -4335,11 +4335,26 @@ eval_map_expr(str) char_u *res; char_u *p; char_u *save_cmd; + pos_T save_cursor; save_cmd = save_cmdline_alloc(); if (save_cmd == NULL) return NULL; + + /* Forbid changing text or using ":normal" to avoid most of the bad side + * effects. Also restore the cursor position. */ + ++textlock; +#ifdef FEAT_EX_EXTRA + ++ex_normal_lock; +#endif + save_cursor = curwin->w_cursor; p = eval_to_string(str, NULL, FALSE); + --textlock; +#ifdef FEAT_EX_EXTRA + --ex_normal_lock; +#endif + curwin->w_cursor = save_cursor; + restore_cmdline_alloc(save_cmd); if (p == NULL) return NULL; diff --git a/src/globals.h b/src/globals.h index 867da5bb84..1287d249cd 100644 --- a/src/globals.h +++ b/src |