Compare commits

...

21 Commits

Author SHA1 Message Date
Bram Moolenaar
667b4d2db9 updated for version 7.3.341
Problem:    Local help files are only listed in help.txt, not in translated
            help files.
Solution:   Also find translated help files. (Yasuhiro Matsumoto)
2011-10-20 18:17:42 +02:00
Bram Moolenaar
f34dc6537d updated for version 7.3.340
Problem:    When 'verbosefile' is set ftplugof.vim can give an error.
Solution:   Only remove filetypeplugin autocommands when they exist. (Yasuhiro
            Matsumoto)
2011-10-20 18:12:32 +02:00
Bram Moolenaar
a4594f6b82 updated for version 7.3.339
Problem:    "make shadow" doesn't link all test files.
Solution:   Add a line in Makefile and Filelist.
2011-10-20 16:35:35 +02:00
Bram Moolenaar
b3479bd229 updated for version 7.3.338
Problem:    Using getchar() in an expression mapping doesn't work well.
Solution:   Don't save and restore the typeahead. (James Vega)
2011-10-12 22:02:14 +02:00
Bram Moolenaar
2e7b1df8fa updated for version 7.3.337
Problem:    Screen doesn't update after resizing the xterm until a character
            is typed.
Solution:   When the select call is interrupted check do_resize. (Taylor
            Hedberg)
2011-10-12 21:04:20 +02:00
Bram Moolenaar
e06461a821 updated for version 7.3.336
Problem:    When a tags file specifies an encoding different from 'enc' it
            may hang and using a pattern doesn't work.
Solution:   Convert the whole line.  Continue reading the header after the
            SORT tag.  Add test83. (Yukihiro Nakadaira)
2011-10-12 19:53:52 +02:00
Bram Moolenaar
725a962194 updated for version 7.3.335
Problem:    When 'imdisable' is reset from an autocommand in Insert mode it
            doesn't take effect.
Solution:   Call im_set_active() in Insert mode. (Taro Muraoka)
2011-10-12 16:57:13 +02:00
Bram Moolenaar
08c51aabc4 updated for version 7.3.334
Problem:    Latest MingW about XSUBPP referencing itself. (Gongqian Li)
Solution:   Rename the first use to XSUBPPTRY.
2011-10-12 14:11:45 +02:00
Bram Moolenaar
ca0c9fcda0 updated for version 7.3.333
Problem:    Using "." to repeat a Visual delete counts the size in bytes, not
            characters.  (Connor Lane Smith)
Solution:   Store the virtual column numbers instead of byte positions.
2011-10-04 21:22:44 +02:00
Bram Moolenaar
e79d1535cf updated for version 7.3.332
Problem:    Indent after "public:" is not increased in C++ code. (Lech Lorens)
Solution:   Check for namespace after the regular checks. (partly by Martin
            Gieseking)
2011-10-04 18:03:47 +02:00
Bram Moolenaar
aa0e80471f updated for version 7.3.331
Problem:    "vit" selects wrong text when a tag name starts with the same text
            as an outer tag name. (Ben Fritz)
Solution:   Add "\>" to the pattern to check for word boundary.
2011-10-04 17:00:20 +02:00
Bram Moolenaar
7701c24e36 updated for version 7.3.330
Problem:    When longjmp() is invoked if the X server gives an error the state
            is not properly restored.
Solution:   Reset vgetc_busy. (Yukihiro Nakadaira)
2011-10-04 16:43:53 +02:00
Bram Moolenaar
946c1eeafc Add files aaded by patch 7.3.326. 2011-10-03 22:12:32 +02:00
Bram Moolenaar
250912918e updated for version 7.3.329
Problem:    When skipping over code from ":for" to ":endfor" get an error for
            calling a dict function. (Yasuhiro Matsumoto)
Solution:   Ignore errors when skipping over :call command.
2011-09-30 18:35:57 +02:00
Bram Moolenaar
73dc59aad8 updated for version 7.3.328
Problem:    When command line wraps the cursor may be displayed wrong when
            there are multi-byte characters.
Solution:   Position the cursor before drawing the text. (Yasuhiro Matsumoto)
2011-09-30 17:46:21 +02:00
Bram Moolenaar
8f535582ad updated for version 7.3.327
Problem:    When jumping to a help tag a closed fold doesn't open.
Solution:   Save and restore KeyTyped. (Yasuhiro Matsumoto)
2011-09-30 17:30:31 +02:00
Bram Moolenaar
2369e35b39 updated for version 7.3.326
Problem:    MingW 4.6 no longer supports the -mno-cygwin option.
Solution:   Split the Cygwin and MingW makefiles. (Matsushita Shougo)
2011-09-30 16:56:02 +02:00
Bram Moolenaar
acd6a049f6 updated for version 7.3.325
Problem:    A duplicated function argument gives an internal error.
Solution:   Give a proper error message. (based on patch by Tyru)
2011-09-30 16:39:48 +02:00
Bram Moolenaar
a627c96182 updated for version 7.3.324
Problem:    Completion for ":compiler" shows color scheme names.
Solution:   Fix the directory name. (James Vega)
2011-09-30 16:23:32 +02:00
Bram Moolenaar
98a22f4a63 updated for version 7.3.323
Problem:    The default 'errorformat' does not ignore some "included from"
            lines.
Solution:   Add a few more patterns. (Ben Boeckel)
2011-09-30 14:44:54 +02:00
Bram Moolenaar
9f733d1ffd updated for version 7.3.322
Problem:    #ifdef for PDP_RETVAL doesn't work, INT_PTR can be a typedef.
Solution:   Check the MSC version and 64 bit flags. (Sergiu Dotenco)
2011-09-21 20:09:42 +02:00
36 changed files with 805 additions and 348 deletions

View File

@@ -81,6 +81,7 @@ SRC_ALL = \
src/testdir/test[0-9]*.ok \
src/testdir/test49.vim \
src/testdir/test60.vim \
src/testdir/test83-tags? \
src/proto.h \
src/proto/blowfish.pro \
src/proto/buffer.pro \
@@ -313,6 +314,7 @@ SRC_DOS = \
src/xxd/Make_bc5.mak \
src/xxd/Make_cyg.mak \
src/xxd/Make_djg.mak \
src/xxd/Make_ming.mak \
src/xxd/Make_mvc.mak \
nsis/gvim.nsi \
nsis/README.txt \

View File

@@ -1,11 +1,13 @@
" Vim support file to switch off loading plugins for file types
"
" Maintainer: Bram Moolenaar <Bram@vim.org>
" Last Change: 2002 Apr 04
" Last Change: 2011 Oct 20
if exists("did_load_ftplugin")
unlet did_load_ftplugin
endif
" Remove all autocommands in the filetypeplugin group
silent! au! filetypeplugin *
" Remove all autocommands in the filetypeplugin group, if any exist.
if exists("#filetypeplugin")
silent! au! filetypeplugin *
endif

77
src/GvimExt/Make_cyg.mak Normal file
View File

@@ -0,0 +1,77 @@
# Project: gvimext
# Generates gvimext.dll with gcc.
# To be used with Cygwin.
#
# Originally, the DLL base address was fixed: -Wl,--image-base=0x1C000000
# Now it is allocated dymanically by the linker by evaluating all DLLs
# already loaded in memory. The binary image contains as well information
# for automatic pseudo-rebasing, if needed by the system. ALV 2004-02-29
# If cross-compiling set this to yes, else set it to no
CROSS = no
#CROSS = yes
# For the old MinGW 2.95 (the one you get e.g. with debian woody)
# set the following variable to yes and check if the executables are
# really named that way.
# If you have a newer MinGW or you are using cygwin set it to no and
# check also the executables
MINGWOLD = no
# Link against the shared versions of libgcc/libstdc++ by default. Set
# STATIC_STDCPLUS to "yes" to link against static versions instead.
STATIC_STDCPLUS=no
#STATIC_STDCPLUS=yes
# Note: -static-libstdc++ is not available until gcc 4.5.x.
LDFLAGS += -shared
ifeq (yes, $(STATIC_STDCPLUS))
LDFLAGS += -static-libgcc -static-libstdc++
endif
ifeq ($(CROSS),yes)
DEL = rm
ifeq ($(MINGWOLD),yes)
CXXFLAGS := -O2 -mno-cygwin -fvtable-thunks
else
CXXFLAGS := -O2 -mno-cygwin
endif
else
CXXFLAGS := -O2 -mno-cygwin
ifneq (sh.exe, $(SHELL))
DEL = rm
else
DEL = del
endif
endif
CXX := $(CROSS_COMPILE)g++
WINDRES := $(CROSS_COMPILE)windres
WINDRES_CXX = $(CXX)
WINDRES_FLAGS = --preprocessor="$(WINDRES_CXX) -E -xc" -DRC_INVOKED
LIBS := -luuid
RES := gvimext.res
DEFFILE = gvimext_ming.def
OBJ := gvimext.o
DLL := gvimext.dll
.PHONY: all all-before all-after clean clean-custom
all: all-before $(DLL) all-after
$(DLL): $(OBJ) $(RES) $(DEFFILE)
$(CXX) $(LDFLAGS) $(CXXFLAGS) -s -o $@ \
-Wl,--enable-auto-image-base \
-Wl,--enable-auto-import \
-Wl,--whole-archive \
$^ \
-Wl,--no-whole-archive \
$(LIBS)
gvimext.o: gvimext.cpp
$(CXX) $(CXXFLAGS) -DFEAT_GETTEXT -c $? -o $@
$(RES): gvimext_ming.rc
$(WINDRES) $(WINDRES_FLAGS) --input-format=rc --output-format=coff -DMING $? -o $@
clean: clean-custom
-$(DEL) $(OBJ) $(RES) $(DLL)

View File

@@ -1,6 +1,6 @@
# Project: gvimext
# Generates gvimext.dll with gcc.
# Can be used for Cygwin and MingW (MingW ignores -mno-cygwin)
# To be used with MingW.
#
# Originally, the DLL base address was fixed: -Wl,--image-base=0x1C000000
# Now it is allocated dymanically by the linker by evaluating all DLLs
@@ -31,12 +31,12 @@ endif
ifeq ($(CROSS),yes)
DEL = rm
ifeq ($(MINGWOLD),yes)
CXXFLAGS := -O2 -mno-cygwin -fvtable-thunks
CXXFLAGS := -O2 -fvtable-thunks
else
CXXFLAGS := -O2 -mno-cygwin
CXXFLAGS := -O2
endif
else
CXXFLAGS := -O2 -mno-cygwin
CXXFLAGS := -O2
ifneq (sh.exe, $(SHELL))
DEL = rm
else
@@ -75,4 +75,3 @@ $(RES): gvimext_ming.rc
clean: clean-custom
-$(DEL) $(OBJ) $(RES) $(DLL)

View File

@@ -536,7 +536,7 @@ xxd/xxd.exe: xxd/xxd.c
$(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 CROSS_COMPILE=$(CROSS_COMPILE)
$(MAKE) -C GvimExt -f Make_cyg.mak CROSS_COMPILE=$(CROSS_COMPILE)
vimrun.exe: vimrun.c
$(CC) $(CFLAGS) -o vimrun.exe vimrun.c $(LIBS)
@@ -565,7 +565,7 @@ ifdef MZSCHEME
endif
-$(DEL) pathdef.c
$(MAKE) -C xxd -f Make_cyg.mak clean
$(MAKE) -C GvimExt -f Make_ming.mak clean
$(MAKE) -C GvimExt -f Make_cyg.mak clean
distclean: clean
-$(DEL) obj$(DIRSLASH)*.o

View File

@@ -108,10 +108,10 @@ endif
# on NT, it's here:
PERLLIB=$(PERL)/lib
PERLLIBS=$(PERLLIB)/Core
XSUBPP=$(PERLLIB)/ExtUtils/xsubpp
XSUBPP_EXISTS=$(shell perl -e "print 1 unless -e '$(XSUBPP)'")
XSUBPPTRY=$(PERLLIB)/ExtUtils/xsubpp
XSUBPP_EXISTS=$(shell perl -e "print 1 unless -e '$(XSUBPPTRY)'")
ifeq "$(XSUBPP_EXISTS)" ""
XSUBPP=perl $(XSUBPP)
XSUBPP=perl $(XSUBPPTRY)
else
XSUBPP=xsubpp
endif
@@ -641,7 +641,7 @@ upx: exes
upx vim.exe
xxd/xxd.exe: xxd/xxd.c
$(MAKE) -C xxd -f Make_cyg.mak CC=$(CC)
$(MAKE) -C xxd -f Make_ming.mak CC=$(CC)
GvimExt/gvimext.dll: GvimExt/gvimext.cpp GvimExt/gvimext.rc GvimExt/gvimext.h
$(MAKE) -C GvimExt -f Make_ming.mak CROSS=$(CROSS) CROSS_COMPILE=$(CROSS_COMPILE)
@@ -659,7 +659,7 @@ ifdef MZSCHEME
-$(DEL) mzscheme_base.c
endif
$(MAKE) -C GvimExt -f Make_ming.mak clean
$(MAKE) -C xxd -f Make_cyg.mak clean
$(MAKE) -C xxd -f Make_ming.mak clean
###########################################################################
INCL = vim.h feature.h os_win32.h os_dos.h ascii.h keymap.h term.h macros.h \

View File

@@ -2328,6 +2328,7 @@ shadow: runtime pixmaps
../../testdir/vimrc.unix \
../../testdir/*.in \
../../testdir/*.vim \
../../testdir/test83-tags? \
../../testdir/*.ok .
# Link needed for doing "make install" in a shadow directory.

View File

@@ -3377,7 +3377,10 @@ ex_call(eap)
/* trans_function_name() doesn't work well when skipping, use eval0()
* instead to skip to any following command, e.g. for:
* :if 0 | call dict.foo().bar() | endif */
eval0(eap->arg, &rettv, &eap->nextcmd, FALSE);
++emsg_skip;
if (eval0(eap->arg, &rettv, &eap->nextcmd, FALSE) != FAIL)
clear_tv(&rettv);
--emsg_skip;
return;
}
@@ -20461,6 +20464,7 @@ ex_function(eap)
exarg_T *eap;
{
char_u *theline;
int i;
int j;
int c;
int saved_did_emsg;
@@ -20707,6 +20711,15 @@ ex_function(eap)
arg = vim_strsave(arg);
if (arg == NULL)
goto erret;
/* Check for duplicate argument name. */
for (i = 0; i < newargs.ga_len; ++i)
if (STRCMP(((char_u **)(newargs.ga_data))[i], arg) == 0)
{
EMSG2(_("E853: Duplicate argument name: %s"), arg);
goto erret;
}
((char_u **)(newargs.ga_data))[newargs.ga_len] = arg;
*p = c;
newargs.ga_len++;

View File

@@ -5508,6 +5508,9 @@ ex_help(eap)
int len;
char_u *lang;
#endif
#ifdef FEAT_FOLDING
int old_KeyTyped = KeyTyped;
#endif
if (eap != NULL)
{
@@ -5671,6 +5674,12 @@ ex_help(eap)
if (!p_im)
restart_edit = 0; /* don't want insert mode in help file */
#ifdef FEAT_FOLDING
/* Restore KeyTyped, setting 'filetype=help' may reset it.
* It is needed for do_tag top open folds under the cursor. */
KeyTyped = old_KeyTyped;
#endif
if (tag != NULL)
do_tag(tag, DT_HELP, 1, FALSE, TRUE);
@@ -5973,6 +5982,7 @@ fix_help_buffer()
char_u *line;
int in_example = FALSE;
int len;
char_u *fname;
char_u *p;
char_u *rt;
int mustfree;
@@ -6019,124 +6029,187 @@ fix_help_buffer()
}
/*
* In the "help.txt" file, add the locally added help files.
* This uses the very first line in the help file.
* In the "help.txt" and "help.abx" file, add the locally added help
* files. This uses the very first line in the help file.
*/
if (fnamecmp(gettail(curbuf->b_fname), "help.txt") == 0)
fname = gettail(curbuf->b_fname);
if (fnamecmp(fname, "help.txt") == 0
#ifdef FEAT_MULTI_LANG
|| (fnamencmp(fname, "help.", 5) == 0
&& ASCII_ISALPHA(fname[5])
&& ASCII_ISALPHA(fname[6])
&& TOLOWER_ASC(fname[7]) == 'x'
&& fname[8] == NUL)
#endif
)
{
for (lnum = 1; lnum < curbuf->b_ml.ml_line_count; ++lnum)
{
line = ml_get_buf(curbuf, lnum, FALSE);
if (strstr((char *)line, "*local-additions*") != NULL)
if (strstr((char *)line, "*local-additions*") == NULL)
continue;
/* Go through all directories in 'runtimepath', skipping
* $VIMRUNTIME. */
p = p_rtp;
while (*p != NUL)
{
/* Go through all directories in 'runtimepath', skipping
* $VIMRUNTIME. */
p = p_rtp;
while (*p != NUL)
copy_option_part(&p, NameBuff, MAXPATHL, ",");
mustfree = FALSE;
rt = vim_getenv((char_u *)"VIMRUNTIME", &mustfree);
if (fullpathcmp(rt, NameBuff, FALSE) != FPC_SAME)
{
copy_option_part(&p, NameBuff, MAXPATHL, ",");
mustfree = FALSE;
rt = vim_getenv((char_u *)"VIMRUNTIME", &mustfree);
if (fullpathcmp(rt, NameBuff, FALSE) != FPC_SAME)
{
int fcount;
char_u **fnames;
FILE *fd;
char_u *s;
int fi;
int fcount;
char_u **fnames;
FILE *fd;
char_u *s;
int fi;
#ifdef FEAT_MBYTE
vimconv_T vc;
char_u *cp;
vimconv_T vc;
char_u *cp;
#endif
/* Find all "doc/ *.txt" files in this directory. */
add_pathsep(NameBuff);
STRCAT(NameBuff, "doc/*.txt");
if (gen_expand_wildcards(1, &NameBuff, &fcount,
&fnames, EW_FILE|EW_SILENT) == OK
&& fcount > 0)
{
for (fi = 0; fi < fcount; ++fi)
{
fd = mch_fopen((char *)fnames[fi], "r");
if (fd != NULL)
{
vim_fgets(IObuff, IOSIZE, fd);
if (IObuff[0] == '*'
&& (s = vim_strchr(IObuff + 1, '*'))
!= NULL)
{
#ifdef FEAT_MBYTE
int this_utf = MAYBE;
#endif
/* Change tag definition to a
* reference and remove <CR>/<NL>. */
IObuff[0] = '|';
*s = '|';
while (*s != NUL)
{
if (*s == '\r' || *s == '\n')
*s = NUL;
#ifdef FEAT_MBYTE
/* The text is utf-8 when a byte
* above 127 is found and no
* illegal byte sequence is found.
*/
if (*s >= 0x80 && this_utf != FALSE)
{
int l;
this_utf = TRUE;
l = utf_ptr2len(s);
if (l == 1)
this_utf = FALSE;
s += l - 1;
}
#endif
++s;
}
#ifdef FEAT_MBYTE
/* The help file is latin1 or utf-8;
* conversion to the current
* 'encoding' may be required. */
vc.vc_type = CONV_NONE;
convert_setup(&vc, (char_u *)(
this_utf == TRUE ? "utf-8"
: "latin1"), p_enc);
if (vc.vc_type == CONV_NONE)
/* No conversion needed. */
cp = IObuff;
else
{
/* Do the conversion. If it fails
* use the unconverted text. */
cp = string_convert(&vc, IObuff,
NULL);
if (cp == NULL)
cp = IObuff;
}
convert_setup(&vc, NULL, NULL);
ml_append(lnum, cp, (colnr_T)0, FALSE);
if (cp != IObuff)
vim_free(cp);
/* Find all "doc/ *.txt" files in this directory. */
add_pathsep(NameBuff);
#ifdef FEAT_MULTI_LANG
STRCAT(NameBuff, "doc/*.??[tx]");
#else
ml_append(lnum, IObuff, (colnr_T)0,
FALSE);
STRCAT(NameBuff, "doc/*.txt");
#endif
++lnum;
}
fclose(fd);
if (gen_expand_wildcards(1, &NameBuff, &fcount,
&fnames, EW_FILE|EW_SILENT) == OK
&& fcount > 0)
{
#ifdef FEAT_MULTI_LANG
int i1;
int i2;
char_u *f1;
char_u *f2;
char_u *t1;
char_u *e1;
char_u *e2;
/* If foo.abx is found use it instead of foo.txt in
* the same directory. */
for (i1 = 0; i1 < fcount; ++i1)
{
for (i2 = 0; i2 < fcount; ++i2)
{
if (i1 == i2)
continue;
if (fnames[i1] == NULL || fnames[i2] == NULL)
continue;
f1 = fnames[i1];
f2 = fnames[i2];
t1 = gettail(f1);
if (fnamencmp(f1, f2, t1 - f1) != 0)
continue;
e1 = vim_strrchr(t1, '.');
e2 = vim_strrchr(gettail(f2), '.');
if (e1 == NUL || e2 == NUL)
continue;
if (fnamecmp(e1, ".txt") != 0
&& fnamecmp(e1, fname + 4) != 0)
{
/* Not .txt and not .abx, remove it. */
vim_free(fnames[i1]);
fnames[i1] = NULL;
continue;
}
if (fnamencmp(f1, f2, e1 - f1) != 0)
continue;
if (fnamecmp(e1, ".txt") == 0
&& fnamecmp(e2, fname + 4) == 0)
{
/* use .abx instead of .txt */
vim_free(fnames[i1]);
fnames[i1] = NULL;
}
}
FreeWild(fcount, fnames);
}
#endif
for (fi = 0; fi < fcount; ++fi)
{
if (fnames[fi] == NULL)
continue;
fd = mch_fopen((char *)fnames[fi], "r");
if (fd != NULL)
{
vim_fgets(IObuff, IOSIZE, fd);
if (IObuff[0] == '*'
&& (s = vim_strchr(IObuff + 1, '*'))
!= NULL)
{
#ifdef FEAT_MBYTE
int this_utf = MAYBE;
#endif
/* Change tag definition to a
* reference and remove <CR>/<NL>. */
IObuff[0] = '|';
*s = '|';
while (*s != NUL)
{
if (*s == '\r' || *s == '\n')
*s = NUL;
#ifdef FEAT_MBYTE
/* The text is utf-8 when a byte
* above 127 is found and no
* illegal byte sequence is found.
*/
if (*s >= 0x80 && this_utf != FALSE)
{
int l;
this_utf = TRUE;
l = utf_ptr2len(s);
if (l == 1)
this_utf = FALSE;
s += l - 1;
}
#endif
++s;
}
#ifdef FEAT_MBYTE
/* The help file is latin1 or utf-8;
* conversion to the current
* 'encoding' may be required. */
vc.vc_type = CONV_NONE;
convert_setup(&vc, (char_u *)(
this_utf == TRUE ? "utf-8"
: "latin1"), p_enc);
if (vc.vc_type == CONV_NONE)
/* No conversion needed. */
cp = IObuff;
else
{
/* Do the conversion. If it fails
* use the unconverted text. */
cp = string_convert(&vc, IObuff,
NULL);
if (cp == NULL)
cp = IObuff;
}
convert_setup(&vc, NULL, NULL);
ml_append(lnum, cp, (colnr_T)0, FALSE);
if (cp != IObuff)
vim_free(cp);
#else
ml_append(lnum, IObuff, (colnr_T)0,
FALSE);
#endif
++lnum;
}
fclose(fd);
}
}
FreeWild(fcount, fnames);
}
if (mustfree)
vim_free(rt);
}
break;
if (mustfree)
vim_free(rt);
}
break;
}
}
}

View File

@@ -371,11 +371,9 @@ static void ex_tag_cmd __ARGS((exarg_T *eap, char_u *name));
# define ex_endif ex_ni
# define ex_else ex_ni
# define ex_while ex_ni
# define ex_for ex_ni
# define ex_continue ex_ni
# define ex_break ex_ni
# define ex_endwhile ex_ni
# define ex_endfor ex_ni
# define ex_throw ex_ni
# define ex_try ex_ni
# define ex_catch ex_ni

View File

@@ -2870,6 +2870,7 @@ put_on_cmdline(str, len, redraw)
{
msg_no_more = TRUE;
i = cmdline_row;
cursorcmd();
draw_cmdline(ccline.cmdpos, ccline.cmdlen - ccline.cmdpos);
/* Avoid clearing the rest of the line too often. */
if (cmdline_row != i || ccline.overstrike)
@@ -4546,7 +4547,7 @@ ExpandFromContext(xp, pat, num_file, file, options)
}
if (xp->xp_context == EXPAND_COMPILER)
{
char *directories[] = {"colors", NULL};
char *directories[] = {"compiler", NULL};
return ExpandRTDir(pat, num_file, file, directories);
}
if (xp->xp_context == EXPAND_OWNSYNTAX)

View File

@@ -2460,27 +2460,18 @@ vgetorpeek(advance)
/*
* Handle ":map <expr>": evaluate the {rhs} as an
* expression. Save and restore the typeahead so that
* getchar() can be used. Also save and restore the
* command line for "normal :".
* expression. Also save and restore the command line
* for "normal :".
*/
if (mp->m_expr)
{
tasave_T tabuf;
int save_vgetc_busy = vgetc_busy;
save_typeahead(&tabuf);
if (tabuf.typebuf_valid)
{
vgetc_busy = 0;
save_m_keys = vim_strsave(mp->m_keys);
save_m_str = vim_strsave(mp->m_str);
s = eval_map_expr(save_m_str, NUL);
vgetc_busy = save_vgetc_busy;
}
else
s = NULL;
restore_typeahead(&tabuf);
vgetc_busy = 0;
save_m_keys = vim_strsave(mp->m_keys);
save_m_str = vim_strsave(mp->m_str);
s = eval_map_expr(save_m_str, NUL);
vgetc_busy = save_vgetc_busy;
}
else
#endif

View File

@@ -1009,6 +1009,7 @@ main_loop(cmdwin, noexmode)
skip_redraw = FALSE;
RedrawingDisabled = 0;
no_wait_return = 0;
vgetc_busy = 0;
# ifdef FEAT_EVAL
emsg_skip = 0;
# endif

View File

@@ -6389,6 +6389,7 @@ get_c_indent()
int lookfor_cpp_namespace = FALSE;
int cont_amount = 0; /* amount for continuation line */
int original_line_islabel;
int added_to_amount = 0;
for (options = curbuf->b_p_cino; *options; )
{
@@ -7216,52 +7217,59 @@ get_c_indent()
else
amount += ind_continuation;
}
else if (lookfor_cpp_namespace)
else
{
if (curwin->w_cursor.lnum == ourscope)
continue;
if (curwin->w_cursor.lnum == 0
|| curwin->w_cursor.lnum
< ourscope - FIND_NAMESPACE_LIM)
break;
l = ml_get_curline();
/*
* If we're in a comment now, skip to the start of the
* comment.
*/
trypos = find_start_comment(ind_maxcomment);
if (trypos != NULL)
{
curwin->w_cursor.lnum = trypos->lnum + 1;
curwin->w_cursor.col = 0;
continue;
}
/*
* Skip preprocessor directives and blank lines.
*/
if (cin_ispreproc_cont(&l, &curwin->w_cursor.lnum))
continue;
if (cin_is_cpp_namespace(l))
{
amount += ind_cpp_namespace;
break;
}
if (cin_nocode(l))
continue;
}
else if (lookfor != LOOKFOR_TERM
if (lookfor != LOOKFOR_TERM
&& lookfor != LOOKFOR_CPP_BASECLASS)
{
amount = scope_amount;
if (theline[0] == '{')
amount += ind_open_extra;
{
amount = scope_amount;
if (theline[0] == '{')
{
amount += ind_open_extra;
added_to_amount = ind_open_extra;
}
}
if (lookfor_cpp_namespace)
{
/*
* Looking for C++ namespace, need to look further
* back.
*/
if (curwin->w_cursor.lnum == ourscope)
continue;
if (curwin->w_cursor.lnum == 0
|| curwin->w_cursor.lnum
< ourscope - FIND_NAMESPACE_LIM)
break;
l = ml_get_curline();
/* If we're in a comment now, skip to the start of
* the comment. */
trypos = find_start_comment(ind_maxcomment);
if (trypos != NULL)
{
curwin->w_cursor.lnum = trypos->lnum + 1;
curwin->w_cursor.col = 0;
continue;
}
/* Skip preprocessor directives and blank lines. */
if (cin_ispreproc_cont(&l, &curwin->w_cursor.lnum))
continue;
/* Finally the actual check for "namespace". */
if (cin_is_cpp_namespace(l))
{
amount += ind_cpp_namespace - added_to_amount;
break;
}
if (cin_nocode(l))
continue;
}
}
break;
}

View File

@@ -20,7 +20,7 @@
*/
static int resel_VIsual_mode = NUL; /* 'v', 'V', or Ctrl-V */
static linenr_T resel_VIsual_line_count; /* number of lines */
static colnr_T resel_VIsual_col; /* nr of cols or end col */
static colnr_T resel_VIsual_vcol; /* nr of cols or end col */
static int restart_VIsual_select = 0;
#endif
@@ -1436,7 +1436,7 @@ do_pending_operator(cap, old_col, gui_yank)
/* The visual area is remembered for redo */
static int redo_VIsual_mode = NUL; /* 'v', 'V', or Ctrl-V */
static linenr_T redo_VIsual_line_count; /* number of lines */
static colnr_T redo_VIsual_col; /* number of cols or end column */
static colnr_T redo_VIsual_vcol; /* number of cols or end column */
static long redo_VIsual_count; /* count for Visual operator */
# ifdef FEAT_VIRTUALEDIT
int include_line_break = FALSE;
@@ -1549,22 +1549,31 @@ do_pending_operator(cap, old_col, gui_yank)
#ifdef FEAT_VISUAL
if (redo_VIsual_busy)
{
/* Redo of an operation on a Visual area. Use the same size from
* redo_VIsual_line_count and redo_VIsual_vcol. */
oap->start = curwin->w_cursor;
curwin->w_cursor.lnum += redo_VIsual_line_count - 1;
if (curwin->w_cursor.lnum > curbuf->b_ml.ml_line_count)
curwin->w_cursor.lnum = curbuf->b_ml.ml_line_count;
VIsual_mode = redo_VIsual_mode;
if (VIsual_mode == 'v')
if (redo_VIsual_vcol == MAXCOL || VIsual_mode == 'v')
{
if (redo_VIsual_line_count <= 1)
curwin->w_cursor.col += redo_VIsual_col - 1;
if (VIsual_mode == 'v')
{
if (redo_VIsual_line_count <= 1)
{
validate_virtcol();
curwin->w_curswant =
curwin->w_virtcol + redo_VIsual_vcol - 1;
}
else
curwin->w_curswant = redo_VIsual_vcol;
}
else
curwin->w_cursor.col = redo_VIsual_col;
}
if (redo_VIsual_col == MAXCOL)
{
curwin->w_curswant = MAXCOL;
coladvance((colnr_T)MAXCOL);
{
curwin->w_curswant = MAXCOL;
}
coladvance(curwin->w_curswant);
}
cap->count0 = redo_VIsual_count;
if (redo_VIsual_count != 0)
@@ -1710,7 +1719,7 @@ do_pending_operator(cap, old_col, gui_yank)
}
}
else if (redo_VIsual_busy)
oap->end_vcol = oap->start_vcol + redo_VIsual_col - 1;
oap->end_vcol = oap->start_vcol + redo_VIsual_vcol - 1;
/*
* Correct oap->end.col and oap->start.col to be the
* upper-left and lower-right corner of the block area.
@@ -1735,13 +1744,22 @@ do_pending_operator(cap, old_col, gui_yank)
*/
resel_VIsual_mode = VIsual_mode;
if (curwin->w_curswant == MAXCOL)
resel_VIsual_col = MAXCOL;
else if (VIsual_mode == Ctrl_V)
resel_VIsual_col = oap->end_vcol - oap->start_vcol + 1;
else if (oap->line_count > 1)
resel_VIsual_col = oap->end.col;
resel_VIsual_vcol = MAXCOL;
else
resel_VIsual_col = oap->end.col - oap->start.col + 1;
{
if (VIsual_mode != Ctrl_V)
getvvcol(curwin, &(oap->end),
NULL, NULL, &oap->end_vcol);
if (VIsual_mode == Ctrl_V || oap->line_count <= 1)
{
if (VIsual_mode != Ctrl_V)
getvvcol(curwin, &(oap->start),
&oap->start_vcol, NULL, NULL);
resel_VIsual_vcol = oap->end_vcol - oap->start_vcol + 1;
}
else
resel_VIsual_vcol = oap->end_vcol;
}
resel_VIsual_line_count = oap->line_count;
}
@@ -1769,7 +1787,7 @@ do_pending_operator(cap, old_col, gui_yank)
if (!redo_VIsual_busy)
{
redo_VIsual_mode = resel_VIsual_mode;
redo_VIsual_col = resel_VIsual_col;
redo_VIsual_vcol = resel_VIsual_vcol;
redo_VIsual_line_count = resel_VIsual_line_count;
redo_VIsual_count = cap->count0;
}
@@ -7631,12 +7649,16 @@ nv_visual(cap)
if (VIsual_mode == 'v')
{
if (resel_VIsual_line_count <= 1)
curwin->w_cursor.col += resel_VIsual_col * cap->count0 - 1;
{
validate_virtcol();
curwin->w_curswant = curwin->w_virtcol
+ resel_VIsual_vcol * cap->count0 - 1;
}
else
curwin->w_cursor.col = resel_VIsual_col;
check_cursor_col();
curwin->w_curswant = resel_VIsual_vcol;
coladvance(curwin->w_curswant);
}
if (resel_VIsual_col == MAXCOL)
if (resel_VIsual_vcol == MAXCOL)
{
curwin->w_curswant = MAXCOL;
coladvance((colnr_T)MAXCOL);
@@ -7645,7 +7667,7 @@ nv_visual(cap)
{
validate_virtcol();
curwin->w_curswant = curwin->w_virtcol
+ resel_VIsual_col * cap->count0 - 1;
+ resel_VIsual_vcol * cap->count0 - 1;
coladvance(curwin->w_curswant);
}
else

View File

@@ -7806,6 +7806,10 @@ set_bool_option(opt_idx, varp, value, opt_flags)
/* Only de-activate it here, it will be enabled when changing mode. */
if (p_imdisable)
im_set_active(FALSE);
else if (State & INSERT)
/* When the option is set from an autocommand, it may need to take
* effect right away. */
im_set_active(curbuf->b_p_iminsert == B_IMODE_IM);
}
#endif

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.),%-GIn file included from %f:%l:%c:,%-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"
#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:%c\\,,%-GIn file included from %f:%l:%c,%-GIn file included from %f:%l,%-G%*[ ]from %f:%l:%c,%-G%*[ ]from %f:%l:,%-G%*[ ]from %f:%l\\,,%-G%*[ ]from %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

@@ -1781,7 +1781,7 @@ swap_me(COLORREF colorref)
}
/* Attempt to make this work for old and new compilers */
#if !defined(_MSC_VER) || (_MSC_VER < 1300) || !defined(INT_PTR)
#if !defined(_WIN64) && (!defined(_MSC_VER) || _MSC_VER < 1300)
# define PDP_RETVAL BOOL
#else
# define PDP_RETVAL INT_PTR

View File

@@ -5146,11 +5146,18 @@ select_eintr:
# endif
# ifdef EINTR
if (ret == -1 && errno == EINTR)
{
/* Check whether window has been resized, EINTR may be caused by
* SIGWINCH. */
if (do_resize)
handle_resize();
/* Interrupted by a signal, need to try again. We ignore msec
* here, because we do want to check even after a timeout if
* characters are available. Needed for reading output of an
* external command after the process has finished. */
goto select_eintr;
}
# endif
# ifdef __TANDEM
if (ret == -1 && errno == ENOTSUP)

View File

@@ -3927,7 +3927,7 @@ again:
curwin->w_cursor = old_pos;
goto theend;
}
sprintf((char *)spat, "<%.*s\\%%(\\_[^>]\\{-}[^/]>\\|>\\)\\c", len, p);
sprintf((char *)spat, "<%.*s\\>\\%%(\\_[^>]\\{-}[^/]>\\|>\\)\\c", len, p);
sprintf((char *)epat, "</%.*s>\\c", len, p);
r = do_searchpair(spat, (char_u *)"", epat, FORWARD, (char_u *)"",

249
src/tag.c
View File

@@ -1277,6 +1277,7 @@ find_tags(pat, num_matches, matchesp, flags, mincount, buf_ffname)
{
FILE *fp;
char_u *lbuf; /* line buffer */
int lbuf_size = LSIZE; /* length of lbuf */
char_u *tag_fname; /* name of tag file */
tagname_T tn; /* info for get_tagfname() */
int first_file; /* trying first tag file */
@@ -1291,6 +1292,7 @@ find_tags(pat, num_matches, matchesp, flags, mincount, buf_ffname)
char_u *s;
int i;
#ifdef FEAT_TAG_BINS
int tag_file_sorted = NUL; /* !_TAG_FILE_SORTED value */
struct tag_search_info /* Binary search file offsets */
{
off_t low_offset; /* offset for first char of first line that
@@ -1360,13 +1362,8 @@ find_tags(pat, num_matches, matchesp, flags, mincount, buf_ffname)
char_u *saved_pat = NULL; /* copy of pat[] */
#endif
/* Use two sets of variables for the pattern: "orgpat" holds the values
* for the original pattern and "convpat" converted from 'encoding' to
* encoding of the tags file. "pats" point to either one of these. */
pat_T *pats;
pat_T orgpat; /* holds unconverted pattern info */
#ifdef FEAT_MBYTE
pat_T convpat; /* holds converted pattern info */
vimconv_T vimconv;
#endif
@@ -1390,7 +1387,6 @@ find_tags(pat, num_matches, matchesp, flags, mincount, buf_ffname)
help_save = curbuf->b_help;
orgpat.pat = pat;
pats = &orgpat;
#ifdef FEAT_MBYTE
vimconv.vc_type = CONV_NONE;
#endif
@@ -1398,7 +1394,7 @@ find_tags(pat, num_matches, matchesp, flags, mincount, buf_ffname)
/*
* Allocate memory for the buffers that are used
*/
lbuf = alloc(LSIZE);
lbuf = alloc(lbuf_size);
tag_fname = alloc(MAXPATHL + 1);
#ifdef FEAT_EMACS_TAGS
ebuf = alloc(LSIZE);
@@ -1424,30 +1420,30 @@ find_tags(pat, num_matches, matchesp, flags, mincount, buf_ffname)
if (help_only) /* want tags from help file */
curbuf->b_help = TRUE; /* will be restored later */
pats->len = (int)STRLEN(pat);
orgpat.len = (int)STRLEN(pat);
#ifdef FEAT_MULTI_LANG
if (curbuf->b_help)
{
/* When "@ab" is specified use only the "ab" language, otherwise
* search all languages. */
if (pats->len > 3 && pat[pats->len - 3] == '@'
&& ASCII_ISALPHA(pat[pats->len - 2])
&& ASCII_ISALPHA(pat[pats->len - 1]))
if (orgpat.len > 3 && pat[orgpat.len - 3] == '@'
&& ASCII_ISALPHA(pat[orgpat.len - 2])
&& ASCII_ISALPHA(pat[orgpat.len - 1]))
{
saved_pat = vim_strnsave(pat, pats->len - 3);
saved_pat = vim_strnsave(pat, orgpat.len - 3);
if (saved_pat != NULL)
{
help_lang_find = &pat[pats->len - 2];
pats->pat = saved_pat;
pats->len -= 3;
help_lang_find = &pat[orgpat.len - 2];
orgpat.pat = saved_pat;
orgpat.len -= 3;
}
}
}
#endif
if (p_tl != 0 && pats->len > p_tl) /* adjust for 'taglength' */
pats->len = p_tl;
if (p_tl != 0 && orgpat.len > p_tl) /* adjust for 'taglength' */
orgpat.len = p_tl;
prepare_pats(pats, has_re);
prepare_pats(&orgpat, has_re);
#ifdef FEAT_TAG_BINS
/* This is only to avoid a compiler warning for using search_info
@@ -1466,13 +1462,13 @@ find_tags(pat, num_matches, matchesp, flags, mincount, buf_ffname)
* Only ignore case when TAG_NOIC not used or 'ignorecase' set.
*/
#ifdef FEAT_TAG_BINS
pats->regmatch.rm_ic = ((p_ic || !noic)
&& (findall || pats->headlen == 0 || !p_tbs));
orgpat.regmatch.rm_ic = ((p_ic || !noic)
&& (findall || orgpat.headlen == 0 || !p_tbs));
for (round = 1; round <= 2; ++round)
{
linear = (pats->headlen == 0 || !p_tbs || round == 2);
linear = (orgpat.headlen == 0 || !p_tbs || round == 2);
#else
pats->regmatch.rm_ic = (p_ic || !noic);
orgpat.regmatch.rm_ic = (p_ic || !noic);
#endif
/*
@@ -1701,6 +1697,36 @@ find_tags(pat, num_matches, matchesp, flags, mincount, buf_ffname)
}
line_read_in:
#ifdef FEAT_MBYTE
if (vimconv.vc_type != CONV_NONE)
{
char_u *conv_line;
int len;
/* Convert every line. Converting the pattern from 'enc' to
* the tags file encoding doesn't work, because characters are
* not recognized. */
conv_line = string_convert(&vimconv, lbuf, NULL);
if (conv_line != NULL)
{
/* Copy or swap lbuf and conv_line. */
len = (int)STRLEN(conv_line) + 1;
if (len > lbuf_size)
{
vim_free(lbuf);
lbuf = conv_line;
lbuf_size = len;
}
else
{
STRCPY(lbuf, conv_line);
vim_free(conv_line);
}
}
}
#endif
#ifdef FEAT_EMACS_TAGS
/*
* Emacs tags line with CTRL-L: New file name on next line.
@@ -1770,6 +1796,33 @@ line_read_in:
*/
if (state == TS_START)
{
if (STRNCMP(lbuf, "!_TAG_", 6) <= 0)
{
/*
* Read header line.
*/
#ifdef FEAT_TAG_BINS
if (STRNCMP(lbuf, "!_TAG_FILE_SORTED\t", 18) == 0)
tag_file_sorted = lbuf[18];
#endif
#ifdef FEAT_MBYTE
if (STRNCMP(lbuf, "!_TAG_FILE_ENCODING\t", 20) == 0)
{
/* Prepare to convert every line from the specified
* encoding to 'encoding'. */
for (p = lbuf + 20; *p > ' ' && *p < 127; ++p)
;
*p = NUL;
convert_setup(&vimconv, lbuf + 20, p_enc);
}
#endif
/* Read the next line. Unrecognized flags are ignored. */
continue;
}
/* Headers ends. */
#ifdef FEAT_TAG_BINS
/*
* When there is no tag head, or ignoring case, need to do a
@@ -1786,24 +1839,20 @@ line_read_in:
if (linear)
# endif
state = TS_LINEAR;
else if (STRNCMP(lbuf, "!_TAG_", 6) > 0)
else if (tag_file_sorted == NUL)
state = TS_BINARY;
else if (STRNCMP(lbuf, "!_TAG_FILE_SORTED\t", 18) == 0)
else if (tag_file_sorted == '1')
state = TS_BINARY;
else if (tag_file_sorted == '2')
{
/* Check sorted flag */
if (lbuf[18] == '1')
state = TS_BINARY;
else if (lbuf[18] == '2')
{
state = TS_BINARY;
sortic = TRUE;
pats->regmatch.rm_ic = (p_ic || !noic);
}
else
state = TS_LINEAR;
state = TS_BINARY;
sortic = TRUE;
orgpat.regmatch.rm_ic = (p_ic || !noic);
}
else
state = TS_LINEAR;
if (state == TS_BINARY && pats->regmatch.rm_ic && !sortic)
if (state == TS_BINARY && orgpat.regmatch.rm_ic && !sortic)
{
/* binary search won't work for ignoring case, use linear
* search. */
@@ -1843,40 +1892,12 @@ line_read_in:
#endif
}
#ifdef FEAT_MBYTE
if (lbuf[0] == '!' && pats == &orgpat
&& STRNCMP(lbuf, "!_TAG_FILE_ENCODING\t", 20) == 0)
{
/* Convert the search pattern from 'encoding' to the
* specified encoding. */
for (p = lbuf + 20; *p > ' ' && *p < 127; ++p)
;
*p = NUL;
convert_setup(&vimconv, p_enc, lbuf + 20);
if (vimconv.vc_type != CONV_NONE)
{
convpat.pat = string_convert(&vimconv, pats->pat, NULL);
if (convpat.pat != NULL)
{
pats = &convpat;
pats->len = (int)STRLEN(pats->pat);
prepare_pats(pats, has_re);
pats->regmatch.rm_ic = orgpat.regmatch.rm_ic;
}
}
/* Prepare for converting a match the other way around. */
convert_setup(&vimconv, lbuf + 20, p_enc);
continue;
}
#endif
/*
* Figure out where the different strings are in this line.
* For "normal" tags: Do a quick check if the tag matches.
* This speeds up tag searching a lot!
*/
if (pats->headlen
if (orgpat.headlen
#ifdef FEAT_EMACS_TAGS
&& !is_etag
#endif
@@ -1933,9 +1954,9 @@ line_read_in:
cmplen = (int)(tagp.tagname_end - tagp.tagname);
if (p_tl != 0 && cmplen > p_tl) /* adjust for 'taglength' */
cmplen = p_tl;
if (has_re && pats->headlen < cmplen)
cmplen = pats->headlen;
else if (state == TS_LINEAR && pats->headlen != cmplen)
if (has_re && orgpat.headlen < cmplen)
cmplen = orgpat.headlen;
else if (state == TS_LINEAR && orgpat.headlen != cmplen)
continue;
#ifdef FEAT_TAG_BINS
@@ -1954,10 +1975,10 @@ line_read_in:
* Compare the current tag with the searched tag.
*/
if (sortic)
tagcmp = tag_strnicmp(tagp.tagname, pats->head,
tagcmp = tag_strnicmp(tagp.tagname, orgpat.head,
(size_t)cmplen);
else
tagcmp = STRNCMP(tagp.tagname, pats->head, cmplen);
tagcmp = STRNCMP(tagp.tagname, orgpat.head, cmplen);
/*
* A match with a shorter tag means to search forward.
@@ -1965,9 +1986,9 @@ line_read_in:
*/
if (tagcmp == 0)
{
if (cmplen < pats->headlen)
if (cmplen < orgpat.headlen)
tagcmp = -1;
else if (cmplen > pats->headlen)
else if (cmplen > orgpat.headlen)
tagcmp = 1;
}
@@ -2011,7 +2032,7 @@ line_read_in:
}
else if (state == TS_SKIP_BACK)
{
if (MB_STRNICMP(tagp.tagname, pats->head, cmplen) != 0)
if (MB_STRNICMP(tagp.tagname, orgpat.head, cmplen) != 0)
state = TS_STEP_FORWARD;
else
/* Have to skip back more. Restore the curr_offset
@@ -2021,7 +2042,7 @@ line_read_in:
}
else if (state == TS_STEP_FORWARD)
{
if (MB_STRNICMP(tagp.tagname, pats->head, cmplen) != 0)
if (MB_STRNICMP(tagp.tagname, orgpat.head, cmplen) != 0)
{
if ((off_t)ftell(fp) > search_info.match_offset)
break; /* past last match */
@@ -2032,7 +2053,7 @@ line_read_in:
else
#endif
/* skip this match if it can't match */
if (MB_STRNICMP(tagp.tagname, pats->head, cmplen) != 0)
if (MB_STRNICMP(tagp.tagname, orgpat.head, cmplen) != 0)
continue;
/*
@@ -2083,41 +2104,41 @@ line_read_in:
if (p_tl != 0 && cmplen > p_tl) /* adjust for 'taglength' */
cmplen = p_tl;
/* if tag length does not match, don't try comparing */
if (pats->len != cmplen)
if (orgpat.len != cmplen)
match = FALSE;
else
{
if (pats->regmatch.rm_ic)
if (orgpat.regmatch.rm_ic)
{
match = (MB_STRNICMP(tagp.tagname, pats->pat, cmplen) == 0);
match = (MB_STRNICMP(tagp.tagname, orgpat.pat, cmplen) == 0);
if (match)
match_no_ic = (STRNCMP(tagp.tagname, pats->pat,
match_no_ic = (STRNCMP(tagp.tagname, orgpat.pat,
cmplen) == 0);
}
else
match = (STRNCMP(tagp.tagname, pats->pat, cmplen) == 0);
match = (STRNCMP(tagp.tagname, orgpat.pat, cmplen) == 0);
}
/*
* Has a regexp: Also find tags matching regexp.
*/
match_re = FALSE;
if (!match && pats->regmatch.regprog != NULL)
if (!match && orgpat.regmatch.regprog != NULL)
{
int cc;
cc = *tagp.tagname_end;
*tagp.tagname_end = NUL;
match = vim_regexec(&pats->regmatch, tagp.tagname, (colnr_T)0);
match = vim_regexec(&orgpat.regmatch, tagp.tagname, (colnr_T)0);
if (match)
{
matchoff = (int)(pats->regmatch.startp[0] - tagp.tagname);
if (pats->regmatch.rm_ic)
matchoff = (int)(orgpat.regmatch.startp[0] - tagp.tagname);
if (orgpat.regmatch.rm_ic)
{
pats->regmatch.rm_ic = FALSE;
match_no_ic = vim_regexec(&pats->regmatch, tagp.tagname,
orgpat.regmatch.rm_ic = FALSE;
match_no_ic = vim_regexec(&orgpat.regmatch, tagp.tagname,
(colnr_T)0);
pats->regmatch.rm_ic = TRUE;
orgpat.regmatch.rm_ic = TRUE;
}
}
*tagp.tagname_end = cc;
@@ -2174,7 +2195,7 @@ line_read_in:
else
mtt = MT_GL_OTH;
}
if (pats->regmatch.rm_ic && !match_no_ic)
if (orgpat.regmatch.rm_ic && !match_no_ic)
mtt += MT_IC_OFF;
if (match_re)
mtt += MT_RE_OFF;
@@ -2187,35 +2208,6 @@ line_read_in:
*/
if (ga_grow(&ga_match[mtt], 1) == OK)
{
#ifdef FEAT_MBYTE
char_u *conv_line = NULL;
char_u *lbuf_line = lbuf;
if (vimconv.vc_type != CONV_NONE)
{
/* Convert the tag line from the encoding of the tags
* file to 'encoding'. Then parse the line again. */
conv_line = string_convert(&vimconv, lbuf, NULL);
if (conv_line != NULL)
{
if (parse_tag_line(conv_line,
#ifdef FEAT_EMACS_TAGS
is_etag,
#endif
&tagp) == OK)
lbuf_line = conv_line;
else
/* doesn't work, go back to unconverted line. */
(void)parse_tag_line(lbuf,
#ifdef FEAT_EMACS_TAGS
is_etag,
#endif
&tagp);
}
}
#else
# define lbuf_line lbuf
#endif
if (help_only)
{
#ifdef FEAT_MULTI_LANG
@@ -2307,7 +2299,7 @@ line_read_in:
* without Emacs tags: <mtt><tag_fname><NUL><lbuf>
*/
len = (int)STRLEN(tag_fname)
+ (int)STRLEN(lbuf_line) + 3;
+ (int)STRLEN(lbuf) + 3;
#ifdef FEAT_EMACS_TAGS
if (is_etag)
len += (int)STRLEN(ebuf) + 1;
@@ -2337,7 +2329,7 @@ line_read_in:
else
*s++ = NUL;
#endif
STRCPY(s, lbuf_line);
STRCPY(s, lbuf);
}
}
@@ -2373,10 +2365,6 @@ line_read_in:
else
vim_free(mfp);
}
#ifdef FEAT_MBYTE
/* Note: this makes the values in "tagp" invalid! */
vim_free(conv_line);
#endif
}
else /* Out of memory! Just forget about the rest. */
{
@@ -2415,19 +2403,12 @@ line_read_in:
}
#endif
#ifdef FEAT_MBYTE
if (pats == &convpat)
{
/* Go back from converted pattern to original pattern. */
vim_free(pats->pat);
vim_free(pats->regmatch.regprog);
orgpat.regmatch.rm_ic = pats->regmatch.rm_ic;
pats = &orgpat;
}
if (vimconv.vc_type != CONV_NONE)
convert_setup(&vimconv, NULL, NULL);
#endif
#ifdef FEAT_TAG_BINS
tag_file_sorted = NUL;
if (sort_error)
{
EMSG2(_("E432: Tags file not sorted: %s"), tag_fname);
@@ -2461,13 +2442,13 @@ line_read_in:
#ifdef FEAT_TAG_BINS
/* stop searching when already did a linear search, or when TAG_NOIC
* used, and 'ignorecase' not set or already did case-ignore search */
if (stop_searching || linear || (!p_ic && noic) || pats->regmatch.rm_ic)
if (stop_searching || linear || (!p_ic && noic) || orgpat.regmatch.rm_ic)
break;
# ifdef FEAT_CSCOPE
if (use_cscope)
break;
# endif
pats->regmatch.rm_ic = TRUE; /* try another time while ignoring case */
orgpat.regmatch.rm_ic = TRUE; /* try another time while ignoring case */
}
#endif
@@ -2480,7 +2461,7 @@ line_read_in:
findtag_end:
vim_free(lbuf);
vim_free(pats->regmatch.regprog);
vim_free(orgpat.regmatch.regprog);
vim_free(tag_fname);
#ifdef FEAT_EMACS_TAGS
vim_free(ebuf);

View File

@@ -29,7 +29,7 @@ SCRIPTS = test1.out test3.out test4.out test5.out test6.out \
test66.out test67.out test68.out test69.out test70.out \
test71.out test72.out test73.out test74.out test75.out \
test76.out test77.out test78.out test79.out test80.out \
test81.out test82.out
test81.out test82.out test83.out
.SUFFIXES: .in .out
@@ -131,3 +131,4 @@ test79.out: test79.in
test80.out: test80.in
test81.out: test81.in
test82.out: test82.in
test83.out: test83.in

View File

@@ -29,7 +29,7 @@ SCRIPTS = test3.out test4.out test5.out test6.out test7.out \
test42.out test52.out test65.out test66.out test67.out \
test68.out test69.out test71.out test72.out test73.out \
test74.out test75.out test76.out test77.out test78.out \
test79.out test80.out test81.out test82.out
test79.out test80.out test81.out test82.out test83.out
SCRIPTS32 = test50.out test70.out

View File

@@ -49,7 +49,7 @@ SCRIPTS = test3.out test4.out test5.out test6.out test7.out \
test42.out test52.out test65.out test66.out test67.out \
test68.out test69.out test71.out test72.out test73.out \
test74.out test75.out test76.out test77.out test78.out \
test79.out test80.out test81.out test82.out
test79.out test80.out test81.out test82.out test83.out
SCRIPTS32 = test50.out test70.out

View File

@@ -29,7 +29,7 @@ SCRIPTS = test1.out test3.out test4.out test5.out test6.out \
test66.out test67.out test68.out test69.out test70.out \
test71.out test72.out test73.out test74.out test75.out \
test76.out test77.out test78.out test79.out test80.out \
test81.out test82.out
test81.out test82.out test83.out
.SUFFIXES: .in .out

View File

@@ -76,7 +76,7 @@ SCRIPT = test1.out test2.out test3.out test4.out test5.out \
test66.out test67.out test68.out test69.out \
test71.out test72.out test74.out test75.out test76.out \
test77.out test78.out test79.out test80.out test81.out \
test82.out
test82.out test83.out
# Known problems:
# Test 30: a problem around mac format - unknown reason

View File

@@ -26,7 +26,7 @@ SCRIPTS = test1.out test2.out test3.out test4.out test5.out test6.out \
test64.out test65.out test66.out test67.out test68.out \
test69.out test70.out test71.out test72.out test73.out \
test74.out test75.out test76.out test77.out test78.out \
test79.out test80.out test81.out test82.out
test79.out test80.out test81.out test82.out test83.out
SCRIPTS_GUI = test16.out
@@ -72,7 +72,7 @@ test1.out: test1.in
fi \
else echo $* NO OUTPUT >>test.log; \
fi"
-rm -rf X* test.ok viminfo
# -rm -rf X* test.ok viminfo
test49.out: test49.vim

View File

@@ -1308,6 +1308,20 @@ protected:
int Test() { return FALSE; }
public: // comment
void testfall();
protected:
void testfall();
};
STARTTEST
:set cino=(0,gs,hs
2kdd]]=][
ENDTEST
class Foo : public Bar
{
public:
virtual void method1(void) = 0;
virtual void method2(int arg1,
int arg2,
int arg3) = 0;

View File

@@ -1190,6 +1190,16 @@ protected:
};
class Foo : public Bar
{
public:
virtual void method1(void) = 0;
virtual void method2(int arg1,
int arg2,
int arg3) = 0;
};
void
foo()
{

View File

@@ -1,5 +1,5 @@
xxx4asdf fail nop ok 9 333
XX111XX
XX111-XX
---222---
1. one
2. two

2
src/testdir/test83-tags2 Normal file
View File

@@ -0,0 +1,2 @@
!_TAG_FILE_ENCODING cp932 //
<EFBFBD>`<60>a<EFBFBD>b Xtags2.txt /<2F>`<60>a<EFBFBD>b

102
src/testdir/test83-tags3 Normal file
View File

@@ -0,0 +1,102 @@
!_TAG_FILE_SORTED 1 //
!_TAG_FILE_ENCODING cp932 //
abc1 Xtags3.txt /<2F>`<60>a<EFBFBD>b
abc2 Xtags3.txt /<2F>`<60>a<EFBFBD>b
abc3 Xtags3.txt /<2F>`<60>a<EFBFBD>b
abc4 Xtags3.txt /<2F>`<60>a<EFBFBD>b
abc5 Xtags3.txt /<2F>`<60>a<EFBFBD>b
abc6 Xtags3.txt /<2F>`<60>a<EFBFBD>b
abc7 Xtags3.txt /<2F>`<60>a<EFBFBD>b
abc8 Xtags3.txt /<2F>`<60>a<EFBFBD>b
abc9 Xtags3.txt /<2F>`<60>a<EFBFBD>b
abc10 Xtags3.txt /<2F>`<60>a<EFBFBD>b
abc11 Xtags3.txt /<2F>`<60>a<EFBFBD>b
abc12 Xtags3.txt /<2F>`<60>a<EFBFBD>b
abc13 Xtags3.txt /<2F>`<60>a<EFBFBD>b
abc14 Xtags3.txt /<2F>`<60>a<EFBFBD>b
abc15 Xtags3.txt /<2F>`<60>a<EFBFBD>b
abc16 Xtags3.txt /<2F>`<60>a<EFBFBD>b
abc17 Xtags3.txt /<2F>`<60>a<EFBFBD>b
abc18 Xtags3.txt /<2F>`<60>a<EFBFBD>b
abc19 Xtags3.txt /<2F>`<60>a<EFBFBD>b
abc20 Xtags3.txt /<2F>`<60>a<EFBFBD>b
abc21 Xtags3.txt /<2F>`<60>a<EFBFBD>b
abc22 Xtags3.txt /<2F>`<60>a<EFBFBD>b
abc23 Xtags3.txt /<2F>`<60>a<EFBFBD>b
abc24 Xtags3.txt /<2F>`<60>a<EFBFBD>b
abc25 Xtags3.txt /<2F>`<60>a<EFBFBD>b
abc26 Xtags3.txt /<2F>`<60>a<EFBFBD>b
abc27 Xtags3.txt /<2F>`<60>a<EFBFBD>b
abc28 Xtags3.txt /<2F>`<60>a<EFBFBD>b
abc29 Xtags3.txt /<2F>`<60>a<EFBFBD>b
abc30 Xtags3.txt /<2F>`<60>a<EFBFBD>b
abc31 Xtags3.txt /<2F>`<60>a<EFBFBD>b
abc32 Xtags3.txt /<2F>`<60>a<EFBFBD>b
abc33 Xtags3.txt /<2F>`<60>a<EFBFBD>b
abc34 Xtags3.txt /<2F>`<60>a<EFBFBD>b
abc35 Xtags3.txt /<2F>`<60>a<EFBFBD>b
abc36 Xtags3.txt /<2F>`<60>a<EFBFBD>b
abc37 Xtags3.txt /<2F>`<60>a<EFBFBD>b
abc38 Xtags3.txt /<2F>`<60>a<EFBFBD>b
abc39 Xtags3.txt /<2F>`<60>a<EFBFBD>b
abc40 Xtags3.txt /<2F>`<60>a<EFBFBD>b
abc41 Xtags3.txt /<2F>`<60>a<EFBFBD>b
abc42 Xtags3.txt /<2F>`<60>a<EFBFBD>b
abc43 Xtags3.txt /<2F>`<60>a<EFBFBD>b
abc44 Xtags3.txt /<2F>`<60>a<EFBFBD>b
abc45 Xtags3.txt /<2F>`<60>a<EFBFBD>b
abc46 Xtags3.txt /<2F>`<60>a<EFBFBD>b
abc47 Xtags3.txt /<2F>`<60>a<EFBFBD>b
abc48 Xtags3.txt /<2F>`<60>a<EFBFBD>b
abc49 Xtags3.txt /<2F>`<60>a<EFBFBD>b
abc50 Xtags3.txt /<2F>`<60>a<EFBFBD>b
abc51 Xtags3.txt /<2F>`<60>a<EFBFBD>b
abc52 Xtags3.txt /<2F>`<60>a<EFBFBD>b
abc53 Xtags3.txt /<2F>`<60>a<EFBFBD>b
abc54 Xtags3.txt /<2F>`<60>a<EFBFBD>b
abc55 Xtags3.txt /<2F>`<60>a<EFBFBD>b
abc56 Xtags3.txt /<2F>`<60>a<EFBFBD>b
abc57 Xtags3.txt /<2F>`<60>a<EFBFBD>b
abc58 Xtags3.txt /<2F>`<60>a<EFBFBD>b
abc59 Xtags3.txt /<2F>`<60>a<EFBFBD>b
abc60 Xtags3.txt /<2F>`<60>a<EFBFBD>b
abc61 Xtags3.txt /<2F>`<60>a<EFBFBD>b
abc62 Xtags3.txt /<2F>`<60>a<EFBFBD>b
abc63 Xtags3.txt /<2F>`<60>a<EFBFBD>b
abc64 Xtags3.txt /<2F>`<60>a<EFBFBD>b
abc65 Xtags3.txt /<2F>`<60>a<EFBFBD>b
abc66 Xtags3.txt /<2F>`<60>a<EFBFBD>b
abc67 Xtags3.txt /<2F>`<60>a<EFBFBD>b
abc68 Xtags3.txt /<2F>`<60>a<EFBFBD>b
abc69 Xtags3.txt /<2F>`<60>a<EFBFBD>b
abc70 Xtags3.txt /<2F>`<60>a<EFBFBD>b
abc71 Xtags3.txt /<2F>`<60>a<EFBFBD>b
abc72 Xtags3.txt /<2F>`<60>a<EFBFBD>b
abc73 Xtags3.txt /<2F>`<60>a<EFBFBD>b
abc74 Xtags3.txt /<2F>`<60>a<EFBFBD>b
abc75 Xtags3.txt /<2F>`<60>a<EFBFBD>b
abc76 Xtags3.txt /<2F>`<60>a<EFBFBD>b
abc77 Xtags3.txt /<2F>`<60>a<EFBFBD>b
abc78 Xtags3.txt /<2F>`<60>a<EFBFBD>b
abc79 Xtags3.txt /<2F>`<60>a<EFBFBD>b
abc80 Xtags3.txt /<2F>`<60>a<EFBFBD>b
abc81 Xtags3.txt /<2F>`<60>a<EFBFBD>b
abc82 Xtags3.txt /<2F>`<60>a<EFBFBD>b
abc83 Xtags3.txt /<2F>`<60>a<EFBFBD>b
abc84 Xtags3.txt /<2F>`<60>a<EFBFBD>b
abc85 Xtags3.txt /<2F>`<60>a<EFBFBD>b
abc86 Xtags3.txt /<2F>`<60>a<EFBFBD>b
abc87 Xtags3.txt /<2F>`<60>a<EFBFBD>b
abc88 Xtags3.txt /<2F>`<60>a<EFBFBD>b
abc89 Xtags3.txt /<2F>`<60>a<EFBFBD>b
abc90 Xtags3.txt /<2F>`<60>a<EFBFBD>b
abc91 Xtags3.txt /<2F>`<60>a<EFBFBD>b
abc92 Xtags3.txt /<2F>`<60>a<EFBFBD>b
abc93 Xtags3.txt /<2F>`<60>a<EFBFBD>b
abc94 Xtags3.txt /<2F>`<60>a<EFBFBD>b
abc95 Xtags3.txt /<2F>`<60>a<EFBFBD>b
abc96 Xtags3.txt /<2F>`<60>a<EFBFBD>b
abc97 Xtags3.txt /<2F>`<60>a<EFBFBD>b
abc98 Xtags3.txt /<2F>`<60>a<EFBFBD>b
abc99 Xtags3.txt /<2F>`<60>a<EFBFBD>b
abc100 Xtags3.txt /<2F>`<60>a<EFBFBD>b

76
src/testdir/test83.in Normal file
View File

@@ -0,0 +1,76 @@
Tests for tag search with !_TAG_FILE_ENCODING.
STARTTEST
:so mbyte.vim
:if !has('iconv')
: e! test.ok
: w! test.out
: qa!
:endif
:set enc=utf8
:/^text for tags1$/,/^text for tags1$/+1w! Xtags1.txt
:/^text for tags2$/,/^text for tags2$/+1w! Xtags2.txt
:/^text for tags3$/,/^text for tags3$/+1w! Xtags3.txt
:/^tags1$/+1,/^tags1-end$/-1w! Xtags1
ggdG
:call setline('.', 'Results of test83')
:" case1:
:new
:set tags=Xtags1
:let v:errmsg = ''
:tag abcdefghijklmnopqrs
:if v:errmsg =~ 'E426:' || getline('.') != 'abcdefghijklmnopqrs'
: close
: put ='case1: failed'
:else
: close
: put ='case1: ok'
:endif
:" case2:
:new
:set tags=test83-tags2
:let v:errmsg = ''
:tag /.
:if v:errmsg =~ 'E426:' || getline('.') != ''
: close
: put ='case2: failed'
:else
: close
: put ='case2: ok'
:endif
:" case3:
:new
:set tags=test83-tags3
:let v:errmsg = ''
:tag abc50
:if v:errmsg =~ 'E426:' || getline('.') != ''
: close
: put ='case3: failed'
:else
: close
: put ='case3: ok'
:endif
:close
:wq! test.out
ENDTEST
text for tags1
abcdefghijklmnopqrs
text for tags2
text for tags3
tags1
!_TAG_FILE_ENCODING utf-8 //
abcdefghijklmnopqrs Xtags1.txt /abcdefghijklmnopqrs
tags1-end

4
src/testdir/test83.ok Normal file
View File

@@ -0,0 +1,4 @@
Results of test83
case1: ok
case2: ok
case3: ok

View File

@@ -709,6 +709,46 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
341,
/**/
340,
/**/
339,
/**/
338,
/**/
337,
/**/
336,
/**/
335,
/**/
334,
/**/
333,
/**/
332,
/**/
331,
/**/
330,
/**/
329,
/**/
328,
/**/
327,
/**/
326,
/**/
325,
/**/
324,
/**/
323,
/**/
322,
/**/
321,
/**/

28
src/xxd/Make_ming.mak Normal file
View File

@@ -0,0 +1,28 @@
# The most simplistic Makefile, for MinGW gcc on MS-DOS
ifndef USEDLL
USEDLL = no
endif
ifeq (yes, $(USEDLL))
DEFINES =
LIBS = -lc
else
DEFINES =
LIBS =
endif
CC = gcc
CFLAGS = -O2 -Wall -DWIN32 $(DEFINES)
ifneq (sh.exe, $(SHELL))
DEL = rm
else
DEL = del
endif
xxd.exe: xxd.c
$(CC) $(CFLAGS) -s -o xxd.exe xxd.c $(LIBS)
clean:
-$(DEL) xxd.exe