Compare commits

..

15 Commits

Author SHA1 Message Date
Bram Moolenaar
42b4ddab95 updated for version 7.2.381
Problem:    No completion for :behave.
Solution:   Add :behave completion.  Minor related fixes. (Dominique Pelle)
2010-03-02 15:56:05 +01:00
Bram Moolenaar
58cb0898a3 updated for version 7.2.380
Problem:    Perl interface builds with 5.10.1 but not with 5.10.0.
Solution:   Change the #ifdefs. (Sergey Khorev)
2010-03-02 15:14:33 +01:00
Bram Moolenaar
8cac9fd020 updated for version 7.2.379
Problem:    'eventignore' is set to an invalid value inside ":doau". (Antony
            Scriven)
Solution:   Don't include the leading comma when the option was empty.
2010-03-02 12:48:05 +01:00
Bram Moolenaar
1a89bbe849 updated for version 7.2.378
Problem:    C function declaration indented too much. (Rui)
Solution:   Don't see a line containing { or } as a type. (Matt Wozniski)
2010-03-02 12:38:22 +01:00
Bram Moolenaar
86ce1cc086 updated for version 7.2.377
Problem:    Misplaced assignment.  Duplicate build line for gvimext.dll.
Solution:   Move setting CROSS_COMPILE to before ifneq.  Remove the wrong
            build line. (Markus Heidelberg)
2010-02-26 22:05:22 +01:00
Bram Moolenaar
72b73c12dc updated for version 7.2.376
Problem:    ml_get error when using SiSU syntax. (Nathan Thomas)
Solution:   If the match ends below the last line move it to the end of the
            last line.
2010-02-24 17:22:20 +01:00
Bram Moolenaar
89c0ea4ea1 updated for version 7.2.375
Problem:    ml_get errors when using ":bprevious" in a BufEnter autocmd.
            (Dominique Pelle)
Solution:   Clear w_valid when entering another buffer.
2010-02-24 16:58:36 +01:00
Bram Moolenaar
3fac56e87e updated for version 7.2.374
Problem:    Ruby eval() doesn't understand Vim types.
Solution:   Add the vim_to_ruby() function.  (George Gensure)
2010-02-24 15:48:04 +01:00
Bram Moolenaar
a4e782eee0 updated for version 7.2.373
Problem:    Gcc 4.5 adds more error messages. (Chris Indy)
Solution:   Update default 'errorformat'.
2010-02-24 15:25:25 +01:00
Bram Moolenaar
48f80c276b updated for version 7.2.372
Problem:    Cross-compiling GvimExt and xxd doesn't work.
Solution:   Change the build files. (Markus Heidelberg)
2010-02-24 15:08:27 +01:00
Bram Moolenaar
25153e127d updated for version 7.2.371
Problem:    Build problems on Tandem NonStop.
Solution:   A few changes to #ifdefs (Joachim Schmitz)
2010-02-24 14:47:08 +01:00
Bram Moolenaar
f4d7f944ba updated for version 7.2.370
Problem:    A redraw may cause folds to be closed.
Solution:   Revert part of the previous patch.  Add a test. (Lech Lorens)
2010-02-24 14:34:19 +01:00
Bram Moolenaar
54c1b4965b updated for version 7.2.369
Problem:    Error message is not easy to understand.
Solution:   Add quotes. (SungHyun Nam)
2010-02-24 14:01:28 +01:00
Bram Moolenaar
83bac8b756 updated for version 7.2.368
Problem:    Ruby interface: Appending line doesn't work. (Michael Henry)
Solution:   Reverse check for NULL line. (James Vega)
2010-02-18 15:53:29 +01:00
Bram Moolenaar
8a33e74dd2 updated for version 7.2.367
Problem:    "xxd -r -p" doesn't work as documented.
Solution:   Skip white space. (James Vega)
2010-02-17 18:28:41 +01:00
31 changed files with 371 additions and 82 deletions

View File

@@ -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

View File

@@ -241,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).

View File

@@ -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)

View File

@@ -241,14 +241,14 @@ 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
CROSS_COMPILE =
ifneq (sh.exe, $(SHELL))
DEL = rm
MKDIR = mkdir -p
@@ -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,10 @@ 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

136
src/auto/configure vendored
View File

@@ -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 <sys/types.h> /* for off_t */
#include <stdio.h>
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 <sys/types.h> /* for off_t */
#include <stdio.h>
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; }

View File

@@ -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 */
{

View File

@@ -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

View File

@@ -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)

View File

@@ -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)

View File

@@ -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.
*/

View File

@@ -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 <fname>"));
EMSG(_("E750: First use \":profile start {fname}\""));
else if (STRCMP(eap->arg, "pause") == 0)
{
if (do_profiling == PROF_YES)

View File

@@ -26,10 +26,12 @@ typedef struct ucmd
long_u uc_argt; /* The argument type */
char_u *uc_rep; /* The command's replacement string */
long uc_def; /* The default value for a range/count */
scid_T uc_scriptID; /* SID where the command was defined */
int uc_compl; /* completion type */
# if defined(FEAT_EVAL) && defined(FEAT_CMDL_COMPL)
# ifdef FEAT_EVAL
scid_T uc_scriptID; /* SID where the command was defined */
# ifdef FEAT_CMDL_COMPL
char_u *uc_compl_arg; /* completion argument if any */
# endif
# endif
} ucmd_T;
@@ -3156,17 +3158,15 @@ set_one_cmd_context(xp, buff)
return NULL;
}
for (ea.cmdidx = (cmdidx_T)0; (int)ea.cmdidx < (int)CMD_SIZE;
ea.cmdidx = (cmdidx_T)((int)ea.cmdidx + 1))
if (STRNCMP(cmdnames[(int)ea.cmdidx].cmd_name, cmd, (size_t)len) == 0)
ea.cmdidx = (cmdidx_T)((int)ea.cmdidx + 1))
if (STRNCMP(cmdnames[(int)ea.cmdidx].cmd_name, cmd,
(size_t)len) == 0)
break;
#ifdef FEAT_USR_CMDS
if (cmd[0] >= 'A' && cmd[0] <= 'Z')
{
while (ASCII_ISALNUM(*p) || *p == '*') /* Allow * wild card */
++p;
len = (int)(p - cmd);
}
#endif
}
@@ -3809,6 +3809,9 @@ set_one_cmd_context(xp, buff)
set_context_in_profile_cmd(xp, arg);
break;
#endif
case CMD_behave:
xp->xp_context = EXPAND_BEHAVE;
break;
#endif /* FEAT_CMDL_COMPL */
@@ -10847,6 +10850,24 @@ ex_behave(eap)
EMSG2(_(e_invarg2), eap->arg);
}
#if defined(FEAT_CMDL_COMPL) || defined(PROTO)
/*
* Function given to ExpandGeneric() to obtain the possible arguments of the
* ":behave {mswin,xterm}" command.
*/
char_u *
get_behave_arg(xp, idx)
expand_T *xp UNUSED;
int idx;
{
if (idx == 0)
return (char_u *)"mswin";
if (idx == 1)
return (char_u *)"xterm";
return NULL;
}
#endif
#ifdef FEAT_AUTOCMD
static int filetype_detect = FALSE;
static int filetype_plugin = FALSE;

View File

@@ -4492,6 +4492,7 @@ ExpandFromContext(xp, pat, num_file, file, options)
} tab[] =
{
{EXPAND_COMMANDS, get_command_name, FALSE},
{EXPAND_BEHAVE, get_behave_arg, TRUE},
#ifdef FEAT_USR_CMDS
{EXPAND_USER_COMMANDS, get_user_commands, FALSE},
{EXPAND_USER_CMD_FLAGS, get_user_cmd_flags, FALSE},

View File

@@ -7925,7 +7925,10 @@ au_event_disable(what)
new_ei = vim_strnsave(p_ei, (int)(STRLEN(p_ei) + STRLEN(what)));
if (new_ei != NULL)
{
STRCAT(new_ei, what);
if (*what == ',' && *p_ei == NUL)
STRCPY(new_ei, what + 1);
else
STRCAT(new_ei, what);
set_string_option_direct((char_u *)"ei", -1, new_ei,
OPT_FREE, SID_NONE);
vim_free(new_ei);

View File

@@ -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;
}

View File

@@ -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 */

View File

@@ -62,6 +62,11 @@
# define PERL589_OR_LATER
#endif
#if (PERL_REVISION == 5) && ((PERL_VERSION > 10) || \
(PERL_VERSION == 10) && (PERL_SUBVERSION >= 1))
# define PERL5101_OR_LATER
#endif
#ifndef pTHX
# define pTHX void
# define pTHX_
@@ -93,7 +98,7 @@ EXTERN_C void boot_DynaLoader __ARGS((pTHX_ CV*));
# define perl_free dll_perl_free
# define Perl_get_context dll_Perl_get_context
# define Perl_croak dll_Perl_croak
# if (PERL_REVISION == 5) && (PERL_VERSION >= 10)
# ifdef PERL5101_OR_LATER
# define Perl_croak_xs_usage dll_Perl_croak_xs_usage
# endif
# ifndef PROTO
@@ -205,7 +210,7 @@ static int (*perl_run)(PerlInterpreter*);
static int (*perl_parse)(PerlInterpreter*, XSINIT_t, int, char**, char**);
static void* (*Perl_get_context)(void);
static void (*Perl_croak)(pTHX_ const char*, ...);
#if (PERL_REVISION == 5) && (PERL_VERSION >= 10)
#ifdef PERL5101_OR_LATER
static void (*Perl_croak_xs_usage)(pTHX_ const CV *const, const char *const params);
#endif
static void (*Perl_croak_nocontext)(const char*, ...);
@@ -312,7 +317,7 @@ static struct {
{"perl_parse", (PERL_PROC*)&perl_parse},
{"Perl_get_context", (PERL_PROC*)&Perl_get_context},
{"Perl_croak", (PERL_PROC*)&Perl_croak},
#if (PERL_REVISION == 5) && (PERL_VERSION >= 10)
#ifdef PERL5101_OR_LATER
{"Perl_croak_xs_usage", (PERL_PROC*)&Perl_croak_xs_usage},
#endif
{"Perl_croak_nocontext", (PERL_PROC*)&Perl_croak_nocontext},

View File

@@ -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)

View File

@@ -7727,11 +7727,14 @@ term_again:
/*
* If the NEXT line is a function declaration, the current
* line needs to be indented as a function type spec.
* Don't do this if the current line looks like a comment
* or if the current line is terminated, ie. ends in ';'.
* Don't do this if the current line looks like a comment or if the
* current line is terminated, ie. ends in ';', or if the current line
* contains { or }: "void f() {\n if (1)"
*/
else if (cur_curpos.lnum < curbuf->b_ml.ml_line_count
&& !cin_nocode(theline)
&& vim_strchr(theline, '{') == NULL
&& vim_strchr(theline, '}') == NULL
&& !cin_ends_in(theline, (char_u *)":", NULL)
&& !cin_ends_in(theline, (char_u *)",", NULL)
&& cin_isfuncdecl(NULL, cur_curpos.lnum + 1)

View File

@@ -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' */

View File

@@ -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

View File

@@ -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 *));

View File

@@ -52,4 +52,5 @@ char_u *expand_sfile __ARGS((char_u *arg));
int put_eol __ARGS((FILE *fd));
int put_line __ARGS((FILE *fd, char *s));
void dialog_msg __ARGS((char_u *buff, char *format, char_u *fname));
char_u *get_behave_arg __ARGS((expand_T *xp, int idx));
/* vim: set ft=c : */

View File

@@ -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);

View File

@@ -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

View File

@@ -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)

View File

@@ -11,6 +11,7 @@ indent 2
folding 9 ii
3 cc
7 gg
8 hh
expr 2
1
2

View File

@@ -681,6 +681,36 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
381,
/**/
380,
/**/
379,
/**/
378,
/**/
377,
/**/
376,
/**/
375,
/**/
374,
/**/
373,
/**/
372,
/**/
371,
/**/
370,
/**/
369,
/**/
368,
/**/
367,
/**/
366,
/**/

View File

@@ -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 <floss.h>
# define ROOT_UID 65535
#else
@@ -593,7 +595,7 @@ extern char *(*dyn_libintl_textdomain)(const char *domainname);
/*
* Terminal highlighting attribute bits.
* Attibutes above HL_ALL are used for syntax highlighting.
* Attributes above HL_ALL are used for syntax highlighting.
*/
#define HL_NORMAL 0x00
#define HL_INVERSE 0x01
@@ -719,6 +721,7 @@ extern char *(*dyn_libintl_textdomain)(const char *domainname);
#define EXPAND_CSCOPE 33
#define EXPAND_SIGN 34
#define EXPAND_PROFILE 35
#define EXPAND_BEHAVE 36
/* Values for exmode_active (0 is no exmode) */
#define EXMODE_NORMAL 1
@@ -1260,7 +1263,7 @@ typedef enum
} hlf_T;
/* The HL_FLAGS must be in the same order as the HLF_ enums!
* When chainging this also adjust the default for 'highlight'. */
* When changing this also adjust the default for 'highlight'. */
#define HL_FLAGS {'8', '@', 'd', 'e', 'h', 'i', 'l', 'm', 'M', \
'n', 'r', 's', 'S', 'c', 't', 'v', 'V', 'w', 'W', \
'f', 'F', 'A', 'C', 'D', 'T', '>', \
@@ -1428,7 +1431,7 @@ typedef enum
#ifdef FEAT_MBYTE
/* We need to call mb_stricmp() even when we aren't dealing with a multi-byte
* encoding because mb_stricmp() takes care of all ascii and non-ascii
* encodings, including characters with umluats in latin1, etc., while
* encodings, including characters with umlauts in latin1, etc., while
* STRICMP() only handles the system locale version, which often does not
* handle non-ascii properly. */

View File

@@ -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

View File

@@ -231,7 +231,7 @@ char *pname;
fprintf(stderr, " or\n %s -r [-s [-]offset] [-c cols] [-ps] [infile [outfile]]\n", pname);
fprintf(stderr, "Options:\n");
fprintf(stderr, " -a toggle autoskip: A single '*' replaces nul-lines. Default off.\n");
fprintf(stderr, " -b binary digit dump (incompatible with -p,-i,-r). Default hex.\n");
fprintf(stderr, " -b binary digit dump (incompatible with -ps,-i,-r). Default hex.\n");
fprintf(stderr, " -c cols format <cols> octets per line. Default 16 (-i: 12, -ps: 30).\n");
fprintf(stderr, " -E show characters in EBCDIC. Default ASCII.\n");
fprintf(stderr, " -g number of octets per group in normal output. Default 2.\n");
@@ -276,11 +276,11 @@ long base_off;
if (c == '\r') /* Doze style input file? */
continue;
#if 0 /* this doesn't work when there is normal text after the hex codes in
the last line that looks like hex */
if (c == ' ' || c == '\n' || c == '\t') /* allow multiple spaces */
/* Allow multiple spaces. This doesn't work when there is normal text
* after the hex codes in the last line that looks like hex, thus only
* use it for PostScript format. */
if (hextype == HEX_POSTSCRIPT && (c == ' ' || c == '\n' || c == '\t'))
continue;
#endif
n3 = n2;
n2 = n1;