From 61cd3f1d7d62cccffc0fd1c9049411f1aa33399a Mon Sep 17 00:00:00 2001 From: edyfox Date: Thu, 25 Feb 2010 06:01:11 +0000 Subject: [PATCH] Merged from the latest developing branch. git-svn-id: https://vim.svn.sourceforge.net/svnroot/vim/trunk@1778 2a77ed30-b011-0410-a7ad-c7884a0aa172 --- src/GvimExt/Make_ming.mak | 8 +-- src/INSTALLpc.txt | 10 +++- src/Make_cyg.mak | 12 ++-- src/Make_ming.mak | 14 +++-- src/auto/configure | 136 +++++++++++++++++++++++++++++++++++++++++++++- src/buffer.c | 5 +- src/config.h.in | 1 - src/configure.in | 6 +- src/diff.c | 35 +++++++----- src/eval.c | 3 +- src/ex_cmds2.c | 2 +- src/fold.c | 6 -- src/if_cscope.c | 4 ++ src/if_ruby.c | 84 +++++++++++++++++++++++++--- src/option.c | 4 ++ src/option.h | 2 +- src/osdef1.h.in | 2 +- src/syntax.c | 6 ++ src/tag.c | 3 +- src/testdir/test45.in | 2 + src/testdir/test45.ok | 1 + src/version.c | 18 ++++++ src/vim.h | 4 +- src/xxd/Make_cyg.mak | 3 +- 24 files changed, 309 insertions(+), 62 deletions(-) diff --git a/src/GvimExt/Make_ming.mak b/src/GvimExt/Make_ming.mak index f10f7301..5997e7ed 100644 --- a/src/GvimExt/Make_ming.mak +++ b/src/GvimExt/Make_ming.mak @@ -20,17 +20,11 @@ MINGWOLD = no ifeq ($(CROSS),yes) DEL = rm ifeq ($(MINGWOLD),yes) -CXX = i586-mingw32msvc-g++ CXXFLAGS := -O2 -mno-cygwin -fvtable-thunks -WINDRES = i586-mingw32msvc-windres else -CXX = i386-mingw32msvc-g++ CXXFLAGS := -O2 -mno-cygwin -WINDRES = i386-mingw32msvc-windres endif else -CXX := g++ -WINDRES := windres CXXFLAGS := -O2 -mno-cygwin ifneq (sh.exe, $(SHELL)) DEL = rm @@ -38,6 +32,8 @@ else DEL = del endif endif +CXX := $(CROSS_COMPILE)g++ +WINDRES := $(CROSS_COMPILE)windres LIBS := -luuid RES := gvimext.res DEFFILE = gvimext_ming.def diff --git a/src/INSTALLpc.txt b/src/INSTALLpc.txt index 755ea3b5..5854c8a0 100644 --- a/src/INSTALLpc.txt +++ b/src/INSTALLpc.txt @@ -215,8 +215,9 @@ directory. You should not need to do *any* editing of any files to get vim compiled this way. If, for some reason, you want the console-mode-only version of vim (this -is NOT recommended on Win32, especially on '95/'98!!!), you need only change -the 'gvim.exe' to 'vim.exe' in the 'make' commands given above. +is NOT recommended on Win32, especially on '95/'98!!!), you can use: + + make -f Make_ming.mak GUI=no vim.exe If you are dismayed by how big the EXE is, I strongly recommend you get 'UPX' (also free!) and compress the file (typical compression is 50%). UPX can be @@ -240,7 +241,7 @@ Use Make_cyg.mak with Cygwin's GCC. See The Cygnus one many not fully work yet. With Cygnus gcc you can use the Unix Makefile instead (you need to get the Unix archive then). Then you get a Cygwin application (feels like Vim is -runnin on Unix), while with Make_cyg.mak you get a Windows application (like +running on Unix), while with Make_cyg.mak you get a Windows application (like with the other makefiles). @@ -259,10 +260,13 @@ 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.mingw.org/wiki/LinuxCrossMinGW http://www.libsdl.org/extras/win32/cross/README.txt 2) Get and unpack both the Unix sources and the extra archive 3) in 'Make_ming.mak', set 'CROSS' to 'yes' instead of 'no'. Make further changes to 'Make_ming.mak' as you wish. + If your cross-compiler prefix differs from the predefined value, + set 'CROSS_COMPILE' corresponding. 4) make -f Make_ming.mak gvim.exe Now you have created the Windows binary from your Linux box! Have fun... diff --git a/src/Make_cyg.mak b/src/Make_cyg.mak index 0a869dc1..f0b4368b 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: 2007 Sep 29 +# Last updated by Dan Sharp. Last Change: 2010 Feb 24 # # Also read INSTALLpc.txt! # @@ -32,9 +32,12 @@ # OLE no or yes: set to yes to make OLE gvim (no) # DEBUG no or yes: set to yes if you wish a DEBUGging build (no) # CPUNR No longer supported, use ARCH. -# ARCH i386 through pentium4: select -march argument to compile with (i386) +# ARCH i386 through pentium4: select -march argument to compile with +# (i386) # USEDLL no or yes: set to yes to use the Runtime library DLL (no) # For USEDLL=yes the cygwin1.dll is required to run Vim. +# "no" does not work with latest version of Cygwin, use +# Make_ming.mak instead. Or set CC to gcc-3. # POSTSCRIPT no or yes: set to yes for PostScript printing (no) # FEATURES TINY, SMALL, NORMAL, BIG or HUGE (BIG) # WINVER Lowest Win32 version to support. (0x0400) @@ -99,6 +102,7 @@ DEFINES = -DWIN32 -DHAVE_PATHDEF -DFEAT_$(FEATURES) \ INCLUDES = -march=$(ARCH) -Iproto #>>>>> name of the compiler and linker, name of lib directory +CROSS_COMPILE = CC = gcc RC = windres @@ -467,10 +471,10 @@ $(EXE): $(OUTDIR) $(OBJ) $(CC) $(CFLAGS) -o $(EXE) $(OBJ) $(LIBS) -luuid -lole32 $(EXTRA_LIBS) xxd/xxd.exe: xxd/xxd.c - $(MAKE) -C xxd -f Make_cyg.mak USEDLL=$(USEDLL) + $(MAKE) -C xxd -f Make_cyg.mak CC=$(CC) USEDLL=$(USEDLL) GvimExt/gvimext.dll: GvimExt/gvimext.cpp GvimExt/gvimext.rc GvimExt/gvimext.h - $(MAKE) -C GvimExt -f Make_ming.mak + $(MAKE) -C GvimExt -f Make_ming.mak CROSS_COMPILE=$(CROSS_COMPILE) vimrun.exe: vimrun.c $(CC) $(CFLAGS) -o vimrun.exe vimrun.c $(LIBS) diff --git a/src/Make_ming.mak b/src/Make_ming.mak index ae28a3d4..ca630de8 100644 --- a/src/Make_ming.mak +++ b/src/Make_ming.mak @@ -241,15 +241,15 @@ DEF_GUI=-DFEAT_GUI_W32 -DFEAT_CLIPBOARD DEFINES=-DWIN32 -DWINVER=$(WINVER) -D_WIN32_WINNT=$(WINVER) \ -DHAVE_PATHDEF -DFEAT_$(FEATURES) ifeq ($(CROSS),yes) -# cross-compiler: -CC = i586-pc-mingw32msvc-gcc +# cross-compiler prefix: +CROSS_COMPILE = i586-pc-mingw32msvc- DEL = rm MKDIR = mkdir -p -WINDRES = i586-pc-mingw32msvc-windres +DIRSLASH = / else # normal (Windows) compilation: -CC = gcc ifneq (sh.exe, $(SHELL)) +CROSS_COMPILE = DEL = rm MKDIR = mkdir -p DIRSLASH = / @@ -258,8 +258,9 @@ DEL = del MKDIR = mkdir DIRSLASH = \\ endif -WINDRES = windres endif +CC := $(CROSS_COMPILE)gcc +WINDRES := $(CROSS_COMPILE)windres #>>>>> end of choices ########################################################################### @@ -549,10 +550,11 @@ upx: exes upx vim.exe xxd/xxd.exe: xxd/xxd.c - $(MAKE) -C xxd -f Make_cyg.mak + $(MAKE) -C xxd -f Make_cyg.mak CC=$(CC) GvimExt/gvimext.dll: GvimExt/gvimext.cpp GvimExt/gvimext.rc GvimExt/gvimext.h $(MAKE) -C GvimExt -f Make_ming.mak + $(MAKE) -C GvimExt -f Make_ming.mak CROSS=$(CROSS) CROSS_COMPILE=$(CROSS_COMPILE) clean: -$(DEL) $(OUTDIR)$(DIRSLASH)*.o diff --git a/src/auto/configure b/src/auto/configure index c2f1d027..0362c5a8 100755 --- a/src/auto/configure +++ b/src/auto/configure @@ -14038,9 +14038,7 @@ fi - - -for ac_func in bcmp fchdir fchown fseeko fsync ftello getcwd getpseudotty \ +for ac_func in bcmp fchdir fchown fsync getcwd getpseudotty \ getpwnam getpwuid getrlimit gettimeofday getwd lstat memcmp \ memset mkdtemp nanosleep opendir putenv qsort readlink select setenv \ setpgid setsid sigaltstack sigstack sigset sigsetjmp sigaction \ @@ -14146,6 +14144,138 @@ _ACEOF fi done +{ $as_echo "$as_me:$LINENO: checking for _LARGEFILE_SOURCE value needed for large files" >&5 +$as_echo_n "checking for _LARGEFILE_SOURCE value needed for large files... " >&6; } +if test "${ac_cv_sys_largefile_source+set}" = set; then + $as_echo_n "(cached) " >&6 +else + while :; do + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include /* for off_t */ + #include +int +main () +{ +int (*fp) (FILE *, off_t, int) = fseeko; + return fseeko (stdin, 0, 0) && fp (stdin, 0, 0); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then + ac_cv_sys_largefile_source=no; break +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + +fi + +rm -rf conftest.dSYM +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#define _LARGEFILE_SOURCE 1 +#include /* for off_t */ + #include +int +main () +{ +int (*fp) (FILE *, off_t, int) = fseeko; + return fseeko (stdin, 0, 0) && fp (stdin, 0, 0); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then + ac_cv_sys_largefile_source=1; break +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + +fi + +rm -rf conftest.dSYM +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext + ac_cv_sys_largefile_source=unknown + break +done +fi +{ $as_echo "$as_me:$LINENO: result: $ac_cv_sys_largefile_source" >&5 +$as_echo "$ac_cv_sys_largefile_source" >&6; } +case $ac_cv_sys_largefile_source in #( + no | unknown) ;; + *) +cat >>confdefs.h <<_ACEOF +#define _LARGEFILE_SOURCE $ac_cv_sys_largefile_source +_ACEOF +;; +esac +rm -rf conftest* + +# We used to try defining _XOPEN_SOURCE=500 too, to work around a bug +# in glibc 2.1.3, but that breaks too many other things. +# If you want fseeko and ftello with glibc, upgrade to a fixed glibc. +if test $ac_cv_sys_largefile_source != unknown; then + +cat >>confdefs.h <<\_ACEOF +#define HAVE_FSEEKO 1 +_ACEOF + +fi + { $as_echo "$as_me:$LINENO: checking for st_blksize" >&5 $as_echo_n "checking for st_blksize... " >&6; } diff --git a/src/buffer.c b/src/buffer.c index a3cd6be3..0569f166 100644 --- a/src/buffer.c +++ b/src/buffer.c @@ -115,7 +115,7 @@ open_buffer(read_stdin, eap) #endif /* mark cursor position as being invalid */ - changed_line_abv_curs(); + curwin->w_valid = 0; if (curbuf->b_ffname != NULL #ifdef FEAT_NETBEANS_INTG @@ -1399,6 +1399,9 @@ enter_buffer(buf) curwin->w_topline_was_set = FALSE; #endif + /* mark cursor position as being invalid */ + curwin->w_valid = 0; + /* Make sure the buffer is loaded. */ if (curbuf->b_ml.ml_mfp == NULL) /* need to load the file */ { diff --git a/src/config.h.in b/src/config.h.in index 2b2730eb..8fc8539c 100644 --- a/src/config.h.in +++ b/src/config.h.in @@ -144,7 +144,6 @@ #undef HAVE_FCHOWN #undef HAVE_FSEEKO #undef HAVE_FSYNC -#undef HAVE_FTELLO #undef HAVE_GETCWD #undef HAVE_GETPSEUDOTTY #undef HAVE_GETPWNAM diff --git a/src/configure.in b/src/configure.in index b7187996..177fa885 100644 --- a/src/configure.in +++ b/src/configure.in @@ -2642,14 +2642,16 @@ if test "x$vim_cv_getcwd_broken" = "xyes" ; then AC_DEFINE(BAD_GETCWD) fi -dnl Check for functions in one big call, to reduce the size of configure -AC_CHECK_FUNCS(bcmp fchdir fchown fseeko fsync ftello getcwd getpseudotty \ +dnl Check for functions in one big call, to reduce the size of configure. +dnl Can only be used for functions that do not require any include. +AC_CHECK_FUNCS(bcmp fchdir fchown fsync getcwd getpseudotty \ getpwnam getpwuid getrlimit gettimeofday getwd lstat memcmp \ memset mkdtemp nanosleep opendir putenv qsort readlink select setenv \ setpgid setsid sigaltstack sigstack sigset sigsetjmp sigaction \ sigvec strcasecmp strerror strftime stricmp strncasecmp \ strnicmp strpbrk strtol tgetent towlower towupper iswupper \ usleep utime utimes) +AC_FUNC_FSEEKO dnl fstatfs() can take 2 to 4 arguments, try to use st_blksize if possible AC_MSG_CHECKING(for st_blksize) diff --git a/src/diff.c b/src/diff.c index f5ea0c69..bf625459 100644 --- a/src/diff.c +++ b/src/diff.c @@ -1117,26 +1117,31 @@ diff_win_options(wp, addbuf) win_T *wp; int addbuf; /* Add buffer to diff. */ { +# ifdef FEAT_FOLDING + win_T *old_curwin = curwin; + + /* close the manually opened folds */ + curwin = wp; + newFoldLevel(); + curwin = old_curwin; +# endif + wp->w_p_diff = TRUE; wp->w_p_scb = TRUE; wp->w_p_wrap = FALSE; # ifdef FEAT_FOLDING - { - win_T *old_curwin = curwin; - - curwin = wp; - curbuf = curwin->w_buffer; - set_string_option_direct((char_u *)"fdm", -1, (char_u *)"diff", + curwin = wp; + curbuf = curwin->w_buffer; + set_string_option_direct((char_u *)"fdm", -1, (char_u *)"diff", OPT_LOCAL|OPT_FREE, 0); - curwin = old_curwin; - curbuf = curwin->w_buffer; - wp->w_p_fdc = diff_foldcolumn; - wp->w_p_fen = TRUE; - wp->w_p_fdl = 0; - foldUpdateAll(wp); - /* make sure topline is not halfway a fold */ - changed_window_setting_win(wp); - } + curwin = old_curwin; + curbuf = curwin->w_buffer; + wp->w_p_fdc = diff_foldcolumn; + wp->w_p_fen = TRUE; + wp->w_p_fdl = 0; + foldUpdateAll(wp); + /* make sure topline is not halfway a fold */ + changed_window_setting_win(wp); # endif #ifdef FEAT_SCROLLBIND if (vim_strchr(p_sbo, 'h') == NULL) diff --git a/src/eval.c b/src/eval.c index f4f3c7a1..87333c2b 100644 --- a/src/eval.c +++ b/src/eval.c @@ -5872,7 +5872,8 @@ list_equal(l1, l2, ic) return item1 == NULL && item2 == NULL; } -#if defined(FEAT_PYTHON) || defined(FEAT_MZSCHEME) || defined(PROTO) +#if defined(FEAT_RUBY) || defined(FEAT_PYTHON) || defined(FEAT_MZSCHEME) \ + || defined(PROTO) /* * Return the dictitem that an entry in a hashtable points to. */ diff --git a/src/ex_cmds2.c b/src/ex_cmds2.c index 94c1f74b..0fcb6c7a 100644 --- a/src/ex_cmds2.c +++ b/src/ex_cmds2.c @@ -1092,7 +1092,7 @@ ex_profile(eap) set_vim_var_nr(VV_PROFILING, 1L); } else if (do_profiling == PROF_NONE) - EMSG(_("E750: First use :profile start ")); + EMSG(_("E750: First use \":profile start {fname}\"")); else if (STRCMP(eap->arg, "pause") == 0) { if (do_profiling == PROF_YES) diff --git a/src/fold.c b/src/fold.c index ff1139dc..a23a35c2 100644 --- a/src/fold.c +++ b/src/fold.c @@ -854,12 +854,6 @@ foldUpdate(wp, top, bot) && fp->fd_top < bot) { fp->fd_small = MAYBE; - - /* Not sure if this is the right place to reset fd_flags (suggested by - * Lech Lorens). */ - if (wp->w_foldinvalid) - fp->fd_flags = FD_LEVEL; - ++fp; } diff --git a/src/if_cscope.c b/src/if_cscope.c index b2a4ce1a..b8fef288 100644 --- a/src/if_cscope.c +++ b/src/if_cscope.c @@ -2278,7 +2278,11 @@ cs_release_csp(i, freefnpp) /* Use sigaction() to limit the waiting time to two seconds. */ sigemptyset(&sa.sa_mask); sa.sa_handler = sig_handler; +# ifdef SA_NODEFER sa.sa_flags = SA_NODEFER; +# else + sa.sa_flags = 0; +# endif sigaction(SIGALRM, &sa, &old); alarm(2); /* 2 sec timeout */ diff --git a/src/if_ruby.c b/src/if_ruby.c index 2295fa5b..6d28de37 100644 --- a/src/if_ruby.c +++ b/src/if_ruby.c @@ -660,20 +660,88 @@ static VALUE vim_command(VALUE self UNUSED, VALUE str) return Qnil; } +#ifdef FEAT_EVAL +static VALUE vim_to_ruby(typval_T *tv) +{ + VALUE result = Qnil; + + if (tv->v_type == VAR_STRING) + { + result = rb_str_new2((char *)tv->vval.v_string); + } + else if (tv->v_type == VAR_NUMBER) + { + result = INT2NUM(tv->vval.v_number); + } +# ifdef FEAT_FLOAT + else if (tv->v_type == VAR_FLOAT) + { + result = rb_float_new(tv->vval.v_float); + } +# endif + else if (tv->v_type == VAR_LIST) + { + list_T *list = tv->vval.v_list; + listitem_T *curr; + + result = rb_ary_new(); + + if (list != NULL) + { + for (curr = list->lv_first; curr != NULL; curr = curr->li_next) + { + rb_ary_push(result, vim_to_ruby(&curr->li_tv)); + } + } + } + else if (tv->v_type == VAR_DICT) + { + result = rb_hash_new(); + + if (tv->vval.v_dict != NULL) + { + hashtab_T *ht = &tv->vval.v_dict->dv_hashtab; + long_u todo = ht->ht_used; + hashitem_T *hi; + dictitem_T *di; + + for (hi = ht->ht_array; todo > 0; ++hi) + { + if (!HASHITEM_EMPTY(hi)) + { + --todo; + + di = dict_lookup(hi); + rb_hash_aset(result, rb_str_new2((char *)hi->hi_key), + vim_to_ruby(&di->di_tv)); + } + } + } + } /* else return Qnil; */ + + return result; +} +#endif + static VALUE vim_evaluate(VALUE self UNUSED, VALUE str) { #ifdef FEAT_EVAL - char_u *value = eval_to_string((char_u *)StringValuePtr(str), NULL, TRUE); + typval_T *tv; + VALUE result; - if (value != NULL) + tv = eval_expr((char_u *)StringValuePtr(str), NULL); + if (tv == NULL) { - VALUE val = rb_str_new2((char *)value); - vim_free(value); - return val; + return Qnil; } - else + result = vim_to_ruby(tv); + + free_tv(tv); + + return result; +#else + return Qnil; #endif - return Qnil; } static VALUE buffer_new(buf_T *buf) @@ -869,7 +937,7 @@ static VALUE buffer_append(VALUE self, VALUE num, VALUE str) long n = NUM2LONG(num); aco_save_T aco; - if (line != NULL) { + if (line == NULL) { rb_raise(rb_eIndexError, "NULL line"); } else if (n >= 0 && n <= buf->b_ml.ml_line_count) diff --git a/src/option.c b/src/option.c index 99e94d5e..ba17c115 100644 --- a/src/option.c +++ b/src/option.c @@ -6586,7 +6586,11 @@ did_set_string_option(opt_idx, varp, new_value_alloced, oldval, errbuf, || *curwin->w_p_fdm == NUL) errmsg = e_invarg; else + { foldUpdateAll(curwin); + if (foldmethodIsDiff(curwin)) + newFoldLevel(); + } } # ifdef FEAT_EVAL /* 'foldexpr' */ diff --git a/src/option.h b/src/option.h index 00374d7e..cfa7692c 100644 --- a/src/option.h +++ b/src/option.h @@ -33,7 +33,7 @@ # ifdef EBCDIC #define DFLT_EFM "%*[^ ] %*[^ ] %f:%l%*[ ]%m,%*[^\"]\"%f\"%*\\D%l: %m,\"%f\"%*\\D%l: %m,%f:%l:%c:%m,%f(%l):%m,%f:%l:%m,\"%f\"\\, line %l%*\\D%c%*[^ ] %m,%D%*\\a[%*\\d]: Entering directory `%f',%X%*\\a[%*\\d]: Leaving directory `%f',%DMaking %*\\a in %f,%f|%l| %m" # else -#define DFLT_EFM "%*[^\"]\"%f\"%*\\D%l: %m,\"%f\"%*\\D%l: %m,%-G%f:%l: (Each undeclared identifier is reported only once,%-G%f:%l: for each function it appears in.),%f:%l:%c:%m,%f(%l):%m,%f:%l:%m,\"%f\"\\, line %l%*\\D%c%*[^ ] %m,%D%*\\a[%*\\d]: Entering directory `%f',%X%*\\a[%*\\d]: Leaving directory `%f',%D%*\\a: Entering directory `%f',%X%*\\a: Leaving directory `%f',%DMaking %*\\a in %f,%f|%l| %m" +#define DFLT_EFM "%*[^\"]\"%f\"%*\\D%l: %m,\"%f\"%*\\D%l: %m,%-G%f:%l: (Each undeclared identifier is reported only once,%-G%f:%l: for each function it appears in.),%-GIn file included from %f:%l:%c,%-GIn file included from %f:%l,%-Gfrom %f:%l:%c,%-Gfrom %f:%l,%f:%l:%c:%m,%f(%l):%m,%f:%l:%m,\"%f\"\\, line %l%*\\D%c%*[^ ] %m,%D%*\\a[%*\\d]: Entering directory `%f',%X%*\\a[%*\\d]: Leaving directory `%f',%D%*\\a: Entering directory `%f',%X%*\\a: Leaving directory `%f',%DMaking %*\\a in %f,%f|%l| %m" # endif # endif # endif diff --git a/src/osdef1.h.in b/src/osdef1.h.in index bdc62479..8190c9b1 100644 --- a/src/osdef1.h.in +++ b/src/osdef1.h.in @@ -25,7 +25,7 @@ extern int fseek __ARGS((FILE *, long, int)); extern int fseeko __ARGS((FILE *, off_t, int)); #endif extern long ftell __ARGS((FILE *)); -#ifdef HAVE_FTELLO +#ifdef HAVE_FSEEKO extern off_t ftello __ARGS((FILE *)); #endif extern void rewind __ARGS((FILE *)); diff --git a/src/syntax.c b/src/syntax.c index 42460585..355d41ce 100644 --- a/src/syntax.c +++ b/src/syntax.c @@ -3086,6 +3086,12 @@ syn_add_start_off(result, regmatch, spp, idx, extra) col = regmatch->startpos[0].col; off = spp->sp_offsets[idx]; } + if (result->lnum > syn_buf->b_ml.ml_line_count) + { + /* a "\n" at the end of the pattern may take us below the last line */ + result->lnum = syn_buf->b_ml.ml_line_count; + col = STRLEN(ml_get_buf(syn_buf, result->lnum, FALSE)); + } if (off != 0) { base = ml_get_buf(syn_buf, result->lnum, FALSE); diff --git a/src/tag.c b/src/tag.c index 5dc56d30..ba36de73 100644 --- a/src/tag.c +++ b/src/tag.c @@ -90,8 +90,9 @@ static char_u *tagmatchname = NULL; /* name of last used tag */ /* * We use ftello() here, if available. It returns off_t instead of long, * which helps if long is 32 bit and off_t is 64 bit. + * We assume that when fseeko() is available then ftello() is too. */ -#ifdef HAVE_FTELLO +#ifdef HAVE_FSEEKO # define ftell ftello #endif diff --git a/src/testdir/test45.in b/src/testdir/test45.in index 1dfad545..e5af5073 100644 --- a/src/testdir/test45.in +++ b/src/testdir/test45.in @@ -36,6 +36,8 @@ Gzk:call append("$", "folding " . getline(".")) k:call append("$", getline(".")) jAcommentstart Acommentend:set fdl=1 3j:call append("$", getline(".")) +:set fdl=0 +zO j:call append("$", getline(".")) :" test expression folding :fun Flvl() let l = getline(v:lnum) diff --git a/src/testdir/test45.ok b/src/testdir/test45.ok index 713cf882..f04996e3 100644 --- a/src/testdir/test45.ok +++ b/src/testdir/test45.ok @@ -11,6 +11,7 @@ indent 2 folding 9 ii 3 cc 7 gg +8 hh expr 2 1 2 diff --git a/src/version.c b/src/version.c index 3d1455f1..1eff44f1 100644 --- a/src/version.c +++ b/src/version.c @@ -682,6 +682,24 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ /**/ + 376, +/**/ + 375, +/**/ + 374, +/**/ + 373, +/**/ + 372, +/**/ + 371, +/**/ + 370, +/**/ + 369, +/**/ + 368, +/**/ 367, /**/ 366, diff --git a/src/vim.h b/src/vim.h index 804070ef..13f00ce9 100644 --- a/src/vim.h +++ b/src/vim.h @@ -52,7 +52,9 @@ /* user ID of root is usually zero, but not for everybody */ #ifdef __TANDEM -# define _TANDEM_SOURCE +# ifndef _TANDEM_SOURCE +# define _TANDEM_SOURCE +# endif # include # define ROOT_UID 65535 #else diff --git a/src/xxd/Make_cyg.mak b/src/xxd/Make_cyg.mak index f04b7bfd..ba74b180 100644 --- a/src/xxd/Make_cyg.mak +++ b/src/xxd/Make_cyg.mak @@ -12,6 +12,7 @@ DEFINES = -mno-cygwin LIBS = endif +CC = gcc CFLAGS = -O2 -Wall -DWIN32 $(DEFINES) ifneq (sh.exe, $(SHELL)) @@ -21,7 +22,7 @@ DEL = del endif xxd.exe: xxd.c - gcc $(CFLAGS) -s -o xxd.exe xxd.c $(LIBS) + $(CC) $(CFLAGS) -s -o xxd.exe xxd.c $(LIBS) clean: -$(DEL) xxd.exe -- 2.11.4.GIT