diff options
author | Bram Moolenaar <Bram@vim.org> | 2004-07-02 15:38:35 +0000 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2004-07-02 15:38:35 +0000 |
commit | cfbc5ee48e1b582f418f2d92ccbc4c4e84c803e1 (patch) | |
tree | 7586fe6160998a4c76a48dab221e38efe55257ef /src | |
parent | 843ee41eb8258ac50ed81976757d8b228382a880 (diff) | |
download | vim-git-cfbc5ee48e1b582f418f2d92ccbc4c4e84c803e1.tar.gz |
updated for version 7.0004
Diffstat (limited to 'src')
-rw-r--r-- | src/GvimExt/Make_ming.mak | 4 | ||||
-rw-r--r-- | src/Make_bc5.mak | 33 | ||||
-rw-r--r-- | src/Make_cyg.mak | 35 | ||||
-rw-r--r-- | src/Make_ming.mak | 15 | ||||
-rw-r--r-- | src/Make_mvc.mak | 7 | ||||
-rw-r--r-- | src/Makefile | 2 | ||||
-rw-r--r-- | src/buffer.c | 6 | ||||
-rw-r--r-- | src/configure.in | 5 | ||||
-rw-r--r-- | src/edit.c | 147 | ||||
-rw-r--r-- | src/eval.c | 8 | ||||
-rw-r--r-- | src/feature.h | 7 | ||||
-rw-r--r-- | src/fileio.c | 1 | ||||
-rw-r--r-- | src/globals.h | 1 | ||||
-rw-r--r-- | src/if_cscope.c | 14 | ||||
-rw-r--r-- | src/normal.c | 6 | ||||
-rw-r--r-- | src/option.c | 45 | ||||
-rw-r--r-- | src/os_unix.c | 29 | ||||
-rw-r--r-- | src/proto/search.pro | 1 | ||||
-rw-r--r-- | src/screen.c | 22 | ||||
-rw-r--r-- | src/search.c | 262 | ||||
-rw-r--r-- | src/structs.h | 6 | ||||
-rw-r--r-- | src/syntax.c | 13 | ||||
-rw-r--r-- | src/testdir/Make_amiga.mak | 3 | ||||
-rw-r--r-- | src/testdir/Make_dos.mak | 2 | ||||
-rw-r--r-- | src/testdir/Make_os2.mak | 2 | ||||
-rw-r--r-- | src/testdir/Make_vms.mms | 4 | ||||
-rw-r--r-- | src/testdir/Makefile | 2 | ||||
-rw-r--r-- | src/testdir/test53.in | 24 | ||||
-rw-r--r-- | src/testdir/test53.ok | 8 | ||||
-rw-r--r-- | src/vim.h | 1 |
30 files changed, 656 insertions, 59 deletions
diff --git a/src/GvimExt/Make_ming.mak b/src/GvimExt/Make_ming.mak index 345625524..9da563951 100644 --- a/src/GvimExt/Make_ming.mak +++ b/src/GvimExt/Make_ming.mak @@ -28,8 +28,8 @@ CXXFLAGS := -O2 -mno-cygwin WINDRES = i386-mingw32msvc-windres endif else -CXX := g++.exe -WINDRES := windres.exe +CXX := g++ +WINDRES := windres CXXFLAGS := -O2 -mno-cygwin endif LIBS := -luuid diff --git a/src/Make_bc5.mak b/src/Make_bc5.mak index 73d9440d8..271820d8e 100644 --- a/src/Make_bc5.mak +++ b/src/Make_bc5.mak @@ -76,6 +76,7 @@ # CSCOPE no or yes: include support for Cscope interface (yes) # NETBEANS no or yes: include support for Netbeans interface (yes if GUI # is yes) +# NBDEBUG no or yes: include support for debugging Netbeans interface (no) # XPM define to path to XPM dir to get support for loading XPM images. ### BOR: root of the BC installation @@ -397,19 +398,6 @@ MBDEFINES = $(MBDEFINES) -DDYNAMIC_GETTEXT DEFINES = $(DEFINES) -DFEAT_CSCOPE !endif -!if ("$(NETBEANS)"=="yes") -DEFINES = $(DEFINES) -DFEAT_NETBEANS_INTG -!if ("$(DEBUG)"=="yes") -DEFINES = $(DEFINES) -DNBDEBUG -NBDEBUG_DEP = nbdebug.h nbdebug.c -!endif -!endif - -!ifdef XPM -DEFINES = $(DEFINES) -DFEAT_XPM_W32 -INCLUDE = $(XPM)\include;$(INCLUDE) -!endif - !if ("$(GUI)"=="yes") DEFINES = $(DEFINES) -DFEAT_GUI_W32 -DFEAT_CLIPBOARD !if ("$(DEBUG)"=="yes") @@ -427,11 +415,13 @@ STARTUPOBJ = c0w32.obj LINK2 = -aa RESFILE = vim.res !else +!undef NETBEANS +!undef XPM +!undef VIMDLL !if ("$(DEBUG)"=="yes") TARGET = vimd.exe !else # for now, anyway: VIMDLL is only for the GUI version -!undef VIMDLL TARGET = vim.exe !endif !if ($(OSTYPE)==DOS16) @@ -447,6 +437,21 @@ LINK2 = -ap -OS -o -P RESFILE = vim.res !endif +!if ("$(NETBEANS)"=="yes") +DEFINES = $(DEFINES) -DFEAT_NETBEANS_INTG +!if ("$(NBDEBUG)"=="yes") +DEFINES = $(DEFINES) -DNBDEBUG +NBDEBUG_DEP = nbdebug.h nbdebug.c +!endif +!endif + +!ifdef XPM +!if ("$(GUI)"=="yes") +DEFINES = $(DEFINES) -DFEAT_XPM_W32 +INCLUDE = $(XPM)\include;$(INCLUDE) +!endif +!endif + !if ("$(USEDLL)"=="yes") DEFINES = $(DEFINES) -D_RTLDLL !endif diff --git a/src/Make_cyg.mak b/src/Make_cyg.mak index e58e3d14c..b8692300a 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: 2004 Apr 23 +# Last updated by Dan Sharp. Last Change: 2004 Jul 01 # # This compiles Vim as a Windows application. If you want Vim to run as a # Cygwin application use the Makefile (just like on Unix). @@ -36,6 +36,7 @@ # OPTIMIZE SPACE, SPEED, or MAXSPEED: set optimization level (MAXSPEED) # NETBEANS no or yes: to include netbeans interface support (yes when GUI # is yes) +# NBDEBUG no or yes: to include netbeans interface debugging support (no) # XPM define to path to XPM dir to get XPM image support (not defined) #>>>>> choose options: ifndef GUI @@ -62,14 +63,16 @@ ifndef IME IME = yes endif -ifndef CPUNR -CPUNR = i386 -endif - ifndef ARCH ARCH = i386 endif +ifndef CPUNR +# Setting -march implicitly sets -mcpu to the same value, +# so reflect that in the defaults here. +CPUNR = $(ARCH) +endif + ifndef WINVER WINVER = 0x0400 endif @@ -293,12 +296,16 @@ EXTRA_OBJS += $(OUTDIR)/if_cscope.o endif ############################## +ifeq ($(GUI),yes) + +############################## ifeq (yes, $(NETBEANS)) +# Only allow NETBEANS for a GUI build. DEFINES += -DFEAT_NETBEANS_INTG EXTRA_OBJS += $(OUTDIR)/netbeans.o $(OUTDIR)/gui_beval.o EXTRA_LIBS += -lwsock32 -ifeq (yes, $(DEBUG)) +ifeq (yes, $(NBDEBUG)) DEFINES += -DNBDEBUG NBDEBUG_DEP = nbdebug.h nbdebug.c endif @@ -307,6 +314,7 @@ endif ############################## ifdef XPM +# Only allow XPM for a GUI build. DEFINES += -DFEAT_XPM_W32 INCLUDES += -I$(XPM)/include EXTRA_OBJS += $(OUTDIR)/xpm_w32.o @@ -314,14 +322,6 @@ EXTRA_LIBS += -L$(XPM)/lib -lXpm endif ############################## -ifeq (yes, $(OLE)) -DEFINES += -DFEAT_OLE -EXTRA_OBJS += $(OUTDIR)/if_ole.o -EXTRA_LIBS += -loleaut32 -lstdc++ -endif - -############################## -ifeq ($(GUI),yes) EXE = gvim$(DEBUG_SUFFIX).exe OUTDIR = gobj$(DEBUG_SUFFIX) DEFINES += -DFEAT_GUI_W32 -DFEAT_CLIPBOARD @@ -334,6 +334,13 @@ LIBS += -luser32 -lgdi32 -lcomdlg32 endif ############################## +ifeq (yes, $(OLE)) +DEFINES += -DFEAT_OLE +EXTRA_OBJS += $(OUTDIR)/if_ole.o +EXTRA_LIBS += -loleaut32 -lstdc++ +endif + +############################## ifneq (sh.exe, $(SHELL)) DEL = rm DIRSLASH = / diff --git a/src/Make_ming.mak b/src/Make_ming.mak index 06780627b..31cd92c26 100644 --- a/src/Make_ming.mak +++ b/src/Make_ming.mak @@ -287,17 +287,24 @@ DEFINES += -DFEAT_CSCOPE endif ifeq ($(NETBEANS),yes) +# Only allow NETBEANS for a GUI build. +ifeq (yes, $(GUI)) DEFINES += -DFEAT_NETBEANS_INTG -ifeq ($(DEBUG), yes) + +ifeq ($(NBDEBUG), yes) DEFINES += -DNBDEBUG NBDEBUG_INCL = nbdebug.h NBDEBUG_SRC = nbdebug.c endif endif +endif ifdef XPM +# Only allow XPM for a GUI build. +ifeq (yes, $(GUI)) CFLAGS += -DFEAT_XPM_W32 -I $(XPM)/include endif +endif ifeq ($(DEBUG),yes) CFLAGS += -g -fstack-check @@ -378,14 +385,20 @@ ifeq ($(CSCOPE),yes) OBJ += $(OUTDIR)/if_cscope.o endif ifeq ($(NETBEANS),yes) +# Only allow NETBEANS for a GUI build. +ifeq (yes, $(GUI)) OBJ += $(OUTDIR)/netbeans.o $(OUTDIR)/gui_beval.o LIB += -lwsock32 endif +endif ifdef XPM +# Only allow XPM for a GUI build. +ifeq (yes, $(GUI)) OBJ += $(OUTDIR)/xpm_w32.o # You'll need libXpm.a from http://gnuwin32.sf.net LIB += -L $(XPM)/lib -lXpm endif +endif ifeq ($(GUI),yes) diff --git a/src/Make_mvc.mak b/src/Make_mvc.mak index 8ee77b63c..d4b74a41f 100644 --- a/src/Make_mvc.mak +++ b/src/Make_mvc.mak @@ -57,6 +57,7 @@ # Processor Version: CPUNR=[i386, i486, i586, i686] (default is i386) # Optimization: OPTIMIZE=[SPACE, SPEED, MAXSPEED] (default is MAXSPEED) # Netbeans Support: NETBEANS=[yes or no] (default is yes if GUI is yes) +# Netbeans Debugging Support: NBDEBUG=[yes or no] (default is no) # XPM Image Support: XPM=[path to XPM directory] # # You can combine any of these interfaces @@ -189,12 +190,15 @@ CSCOPE_DEFS = -DFEAT_CSCOPE NETBEANS = $(GUI) !endif +# Only allow NETBEANS and XPM for a GUI build. +!if "$(GUI)" == "yes" !if "$(NETBEANS)" == "yes" # NETBEANS - Include support for Netbeans integration NETBEANS_PRO = proto/netbeans.pro NETBEANS_OBJ = $(OBJDIR)/netbeans.obj $(OBJDIR)/gui_beval.obj NETBEANS_DEFS = -DFEAT_NETBEANS_INTG -!if "$(DEBUG)" == "yes" + +!if "$(NBDEBUG)" == "yes" NBDEBUG_DEFS = -DNBDEBUG NBDEBUG_INCL = nbdebug.h NBDEBUG_SRC = nbdebug.c @@ -210,6 +214,7 @@ XPM_DEFS = -DFEAT_XPM_W32 XPM_LIB = $(XPM)\lib\libXpm.lib XPM_INC = -I $(XPM)\include !endif +!endif !if defined(USE_MSVCRT) CVARS = $(cvarsdll) diff --git a/src/Makefile b/src/Makefile index 7e4c385b0..e19dabc5b 100644 --- a/src/Makefile +++ b/src/Makefile @@ -336,7 +336,6 @@ CClink = $(CC) # use it (e.g., want a GTK-only version), then use --enable-gui=gtk. # # If the selected GUI isn't found, the GUI is disabled automatically -#CONF_OPT_GUI = --enable-gui=kde #CONF_OPT_GUI = --enable-gui=gtk #CONF_OPT_GUI = --enable-gui=gtk --disable-gtktest #CONF_OPT_GUI = --enable-gui=gtk2 @@ -344,6 +343,7 @@ CClink = $(CC) #CONF_OPT_GUI = --enable-gui=gnome #CONF_OPT_GUI = --enable-gui=gnome2 #CONF_OPT_GUI = --enable-gui=gnome2 --disable-gtktest +#CONF_OPT_GUI = --enable-gui=kde #CONF_OPT_GUI = --enable-gui=motif #CONF_OPT_GUI = --enable-gui=motif --with-motif-lib="-static -lXm -shared" #CONF_OPT_GUI = --enable-gui=athena diff --git a/src/buffer.c b/src/buffer.c index 27f64bd5f..6249005ac 100644 --- a/src/buffer.c +++ b/src/buffer.c @@ -1668,6 +1668,9 @@ free_buf_options(buf, free_p_ff) #ifdef FEAT_INS_EXPAND clear_string_option(&buf->b_p_cpt); #endif +#ifdef FEAT_COMPL_FUNC + clear_string_option(&buf->b_p_cfu); +#endif #ifdef FEAT_QUICKFIX clear_string_option(&buf->b_p_gp); clear_string_option(&buf->b_p_mp); @@ -1680,6 +1683,9 @@ free_buf_options(buf, free_p_ff) clear_string_option(&buf->b_p_dict); clear_string_option(&buf->b_p_tsr); #endif +#ifdef FEAT_TEXTOBJ + clear_string_option(&buf->b_p_qe); +#endif buf->b_p_ar = -1; } diff --git a/src/configure.in b/src/configure.in index 1ebf82c18..42d6bfadb 100644 --- a/src/configure.in +++ b/src/configure.in @@ -1251,7 +1251,10 @@ AC_DEFUN(AM_PATH_KDE, KDE_LIBS="$KDE_PREFIX/lib" fi if test "x$KDE_INCLUDES" = "x"; then - KDE_INCLUDES="$KDE_PREFIX/include" + KDE_INCLUDES="$KDE_PREFIX/include" + if test -d "$KDE_INCLUDES/kde"; then + KDE_INCLUDES="$KDE_INCLUDES/kde" + fi fi kde_major_version=`$KDE_CONFIG --version | grep KDE | \ sed 's/KDE:\ //' | sed 's/\([[0-9]]*\).\([[0-9]]*.*\)/\1/'` diff --git a/src/edit.c b/src/edit.c index 1adcda414..0ca698c3f 100644 --- a/src/edit.c +++ b/src/edit.c @@ -30,6 +30,7 @@ #define CTRL_X_DICTIONARY (9 + CTRL_X_WANT_IDENT) #define CTRL_X_THESAURUS (10 + CTRL_X_WANT_IDENT) #define CTRL_X_CMDLINE 11 +#define CTRL_X_FUNCTION 12 #define CHECK_KEYS_TIME 30 @@ -38,7 +39,7 @@ static char *ctrl_x_msgs[] = { N_(" Keyword completion (^N^P)"), /* ctrl_x_mode == 0, ^P/^N compl. */ - N_(" ^X mode (^E^Y^L^]^F^I^K^D^V^N^P)"), + N_(" ^X mode (^E^Y^L^]^F^I^K^D^U^V^N^P)"), /* Scroll has it's own msgs, in it's place there is the msg for local * ctrl_x_mode = 0 (eg continue_status & CONT_LOCAL) -- Acevedo */ N_(" Keyword Local completion (^N^P)"), @@ -50,7 +51,8 @@ static char *ctrl_x_msgs[] = NULL, N_(" Dictionary completion (^K^N^P)"), N_(" Thesaurus completion (^T^N^P)"), - N_(" Command-line completion (^V^N^P)") + N_(" Command-line completion (^V^N^P)"), + N_(" User defined completion (^U^N^P)"), }; static char_u e_hitend[] = N_("Hit end of paragraph"); @@ -762,7 +764,7 @@ edit(cmdchar, startln, count) #ifdef FEAT_INS_EXPAND /* Enter CTRL-X mode */ case Ctrl_X: - /* CTRL-X after CTRL-V CTRL-X doesn't do anything, so that CTRL-X + /* CTRL-X after CTRL-X CTRL-V doesn't do anything, so that CTRL-X * CTRL-V works like CTRL-N */ if (ctrl_x_mode != CTRL_X_CMDLINE) { @@ -1030,6 +1032,12 @@ doESCkey: /* delete all inserted text in current line */ case Ctrl_U: +# ifdef FEAT_COMPL_FUNC + /* CTRL-X CTRL-U completes with 'completefunc'. */ + if (ctrl_x_mode == CTRL_X_NOT_DEFINED_YET + || ctrl_x_mode == CTRL_X_FUNCTION) + goto docomplete; +# endif did_backspace = ins_bs(c, BACKSPACE_LINE, &inserted_space); auto_format(FALSE, TRUE); inserted_space = FALSE; @@ -1914,6 +1922,10 @@ vim_is_ctrl_x_key(c) case CTRL_X_CMDLINE: return (c == Ctrl_V || c == Ctrl_Q || c == Ctrl_P || c == Ctrl_N || c == Ctrl_X); +#ifdef FEAT_COMPL_FUNC + case CTRL_X_FUNCTION: + return (c == Ctrl_U || c == Ctrl_P || c == Ctrl_N || c == Ctrl_X); +#endif } EMSG(_(e_internal)); return FALSE; @@ -2416,6 +2428,11 @@ ins_compl_prep(c) case Ctrl_T: ctrl_x_mode = CTRL_X_THESAURUS; break; +#ifdef FEAT_COMPL_FUNC + case Ctrl_U: + ctrl_x_mode = CTRL_X_FUNCTION; + break; +#endif case Ctrl_RSB: ctrl_x_mode = CTRL_X_TAGS; break; @@ -2622,6 +2639,88 @@ ins_compl_next_buf(buf, flag) return buf; } +#ifdef FEAT_COMPL_FUNC +static char_u *call_completefunc __ARGS((char_u *line, char_u *base, int col, int preproc)); +static int expand_by_function __ARGS((int lnum, int col, char_u *base, char_u ***matches)); + +/* + * Execute user defined complete function 'completefunc'. + * Return NULL if some error occurs. + */ + static char_u * +call_completefunc(line, base, col, preproc) + char_u *line; + char_u *base; + int col; + int preproc; +{ + char_u colbuf[30]; + char_u *args[4]; + + /* Return NULL when 'completefunc' isn't set. */ + if (*curbuf->b_p_cfu == NUL) + return NULL; + + sprintf((char *)colbuf, "%d", col + (base ? (int)STRLEN(base) : 0)); + args[0] = line; + args[1] = base; + args[2] = colbuf; + args[3] = preproc ? "1" : "0"; + return call_vim_function(curbuf->b_p_cfu, 4, args, FALSE); +} + +/* + * Execute user defined complete function 'completefunc', and get candidates + * are separeted with "\n". Return value is number of candidates and array + * of candidates as "matches". + */ + static int +expand_by_function(lnum, col, base, matches) + int lnum; + int col; + char_u *base; + char_u ***matches; +{ + char_u *matchstr = NULL; + + /* Execute 'completefunc' and get the result */ + matchstr = call_completefunc(ml_get_buf(curbuf, lnum, FALSE), base, col, 0); + + /* Parse returned string */ + if (matchstr != NULL) + { + garray_T ga; + char_u *p, *pnext; + + ga_init2(&ga, (int)sizeof(char*), 8); + for (p = matchstr; *p != NUL; p = pnext) + { + int len; + + pnext = vim_strchr(p, '\n'); + if (pnext == NULL) + pnext = p + STRLEN(p); + len = pnext - p; + if (len > 0) + { + if (ga_grow(&ga, 1) == FAIL) + break; + ((char_u **)ga.ga_data)[ga.ga_len] = vim_strnsave(p, len); + ++ga.ga_len; + --ga.ga_room; + } + if (*pnext != NUL) + ++pnext; + } + vim_free(matchstr); + if (ga.ga_len > 0) + *matches = (char_u**)ga.ga_data; + return ga.ga_len; + } + return 0; +} +#endif /* FEAT_COMPL_FUNC */ + /* * Get the next expansion(s) for the text starting at the initial curbuf * position "ini" and in the direction dir. @@ -2660,7 +2759,8 @@ ins_compl_get_exp(ini, dir) ins_buf->b_scanned = 0; found_all = FALSE; ins_buf = curbuf; - e_cpt = continue_status & CONT_LOCAL ? (char_u *)"." : curbuf->b_p_cpt; + e_cpt = (continue_status & CONT_LOCAL) + ? (char_u *)"." : curbuf->b_p_cpt; last_match_pos = first_match_pos = *ini; } @@ -2828,6 +2928,15 @@ ins_compl_get_exp(ini, dir) ins_compl_add_matches(num_matches, matches, dir); break; +#ifdef FEAT_COMPL_FUNC + case CTRL_X_FUNCTION: + num_matches = expand_by_function(first_match_pos.lnum, + first_match_pos.col, complete_pat, &matches); + if (num_matches > 0) + ins_compl_add_matches(num_matches, matches, dir); + break; +#endif + default: /* normal ^P/^N and ^X^L */ /* * If 'infercase' is set, don't use 'smartcase' here @@ -3404,6 +3513,36 @@ ins_complete(c) tmp_ptr = line + temp; temp = complete_col - temp; } +#ifdef FEAT_COMPL_FUNC + else if (ctrl_x_mode == CTRL_X_FUNCTION) + { + /* + * Call user defined function 'completefunc' with line content, + * cursor column number and preproc is 1. Obtain length of text + * to use for completion. + */ + char_u *lenstr; + int keeplen = 0; + + /* Call 'completefunc' and get pattern length as a string */ + lenstr = call_completefunc(line, NULL, complete_col, 1); + if (lenstr == NULL) + return FAIL; + keeplen = atoi(lenstr); + vim_free(lenstr); + if (keeplen < 0) + return FAIL; + if ((colnr_T)keeplen > complete_col) + keeplen = complete_col; + + /* Setup variables for completion */ + tmp_ptr = line + keeplen; + temp = complete_col - keeplen; + complete_pat = vim_strnsave(tmp_ptr, temp); + if (complete_pat == NULL) + return FAIL; + } +#endif complete_col = (colnr_T) (tmp_ptr - line); if (continue_status & CONT_ADDING) diff --git a/src/eval.c b/src/eval.c index 5e405157f..7ef1398d7 100644 --- a/src/eval.c +++ b/src/eval.c @@ -741,6 +741,14 @@ call_vim_function(func, argc, argv, safe) for (i = 0; i < argc; i++) { + /* Pass a NULL or empty argument as an empty string */ + if (argv[i] == NULL || *argv[i] == NUL) + { + argvars[i].var_type = VAR_STRING; + argvars[i].var_val.var_string = ""; + continue; + } + /* Recognize a number argument, the others must be strings. */ vim_str2nr(argv[i], NULL, &len, TRUE, TRUE, &n, NULL); if (len != 0 && len == (int)STRLEN(argv[i])) diff --git a/src/feature.h b/src/feature.h index 8ebe94fd3..7bd73e7c2 100644 --- a/src/feature.h +++ b/src/feature.h @@ -379,6 +379,13 @@ #endif /* + * Insert mode completion with 'completefunc'. + */ +#if defined(FEAT_INS_EXPAND) && defined(FEAT_EVAL) +# define FEAT_COMPL_FUNC +#endif + +/* * +user_commands Allow the user to define his own commands. */ #ifdef FEAT_NORMAL diff --git a/src/fileio.c b/src/fileio.c index 92c1e98bb..240c7e9d0 100644 --- a/src/fileio.c +++ b/src/fileio.c @@ -6628,6 +6628,7 @@ static struct event_name {"BufWriteCmd", EVENT_BUFWRITECMD}, {"CmdwinEnter", EVENT_CMDWINENTER}, {"CmdwinLeave", EVENT_CMDWINLEAVE}, + {"ColorScheme", EVENT_COLORSCHEME}, {"EncodingChanged", EVENT_ENCODINGCHANGED}, {"FileEncoding", EVENT_ENCODINGCHANGED}, {"CursorHold", EVENT_CURSORHOLD}, diff --git a/src/globals.h b/src/globals.h index 8a59f1ccb..026a3fe79 100644 --- a/src/globals.h +++ b/src/globals.h @@ -1004,6 +1004,7 @@ EXTERN char_u *globaldir INIT(= NULL); EXTERN int lcs_eol INIT(= '$'); EXTERN int lcs_ext INIT(= NUL); EXTERN int lcs_prec INIT(= NUL); +EXTERN int lcs_nbsp INIT(= NUL); EXTERN int lcs_tab1 INIT(= NUL); EXTERN int lcs_tab2 INIT(= NUL); EXTERN int lcs_trail INIT(= NUL); diff --git a/src/if_cscope.c b/src/if_cscope.c index eec3de8de..012e86c76 100644 --- a/src/if_cscope.c +++ b/src/if_cscope.c @@ -434,14 +434,14 @@ cs_add_common(arg1, arg2, flags) char *flags; { struct stat statbuf; - int ret; - char *fname = NULL; - char *fname2 = NULL; - char *ppath = NULL; - int i; + int ret; + char *fname = NULL; + char *fname2 = NULL; + char *ppath = NULL; + int i; /* get the filename (arg1), expand it, and try to stat it */ - if ((fname = (char *)alloc(MAXPATHL+1)) == NULL) + if ((fname = (char *)alloc(MAXPATHL + 1)) == NULL) goto add_err; expand_env((char_u *)arg1, (char_u *)fname, MAXPATHL); @@ -459,7 +459,7 @@ staterr: { struct stat statbuf2; - if ((ppath = (char *)alloc(MAXPATHL+1)) == NULL) + if ((ppath = (char *)alloc(MAXPATHL + 1)) == NULL) goto add_err; expand_env((char_u *)arg2, (char_u *)ppath, MAXPATHL); diff --git a/src/normal.c b/src/normal.c index 8fb8c028d..330356ce9 100644 --- a/src/normal.c +++ b/src/normal.c @@ -8257,6 +8257,12 @@ nv_object(cap) case 's': /* "as" = a sentence */ flag = current_sent(cap->oap, cap->count1, include); break; + case '"': /* "a"" = a double quoted string */ + case '\'': /* "a'" = a single quoted string */ + case '`': /* "a`" = a backtick quoted string */ + flag = current_quote(cap->oap, cap->count1, include, + cap->nchar); + break; #if 0 /* TODO */ case 'S': /* "aS" = a section */ case 'f': /* "af" = a filename */ diff --git a/src/option.c b/src/option.c index 948018d3b..d48c84095 100644 --- a/src/option.c +++ b/src/option.c @@ -62,6 +62,7 @@ typedef enum , PV_CMS , PV_COM , PV_CPT + , PV_CFU , PV_DEF , PV_DICT , PV_DIFF @@ -109,6 +110,7 @@ typedef enum , PV_PATH , PV_PI , PV_PVW + , PV_QE , PV_RL , PV_RLC , PV_RO @@ -169,6 +171,9 @@ static char_u *p_cms; #ifdef FEAT_INS_EXPAND static char_u *p_cpt; #endif +#ifdef FEAT_COMPL_FUNC +static char_u *p_cfu; +#endif static int p_eol; static int p_et; #ifdef FEAT_MBYTE @@ -205,6 +210,9 @@ static char_u *p_nf; static char_u *p_oft; #endif static int p_pi; +#ifdef FEAT_TEXTOBJ +static char_u *p_qe; +#endif static int p_ro; #ifdef FEAT_SMARTINDENT static int p_si; @@ -624,6 +632,15 @@ static struct vimoption {(char_u *)0L, (char_u *)0L} #endif }, + {"completefunc", "cfu", P_STRING|P_ALLOCED|P_VI_DEF|P_SECURE, +#ifdef FEAT_COMPL_FUNC + (char_u *)&p_cfu, PV_CFU, + {(char_u *)"", (char_u *)0L} +#else + (char_u *)NULL, PV_NONE, + {(char_u *)0L, (char_u *)0L} +#endif + }, {"confirm", "cf", P_BOOL|P_VI_DEF, #if defined(FEAT_GUI_DIALOG) || defined(FEAT_CON_DIALOG) (char_u *)&p_confirm, PV_NONE, @@ -1658,6 +1675,15 @@ static struct vimoption {"prompt", NULL, P_BOOL|P_VI_DEF, (char_u *)NULL, PV_NONE, {(char_u *)FALSE, (char_u *)0L}}, + {"quoteescape", "qe", P_STRING|P_ALLOCED|P_VI_DEF, +#ifdef FEAT_TEXTOBJ + (char_u *)&p_qe, PV_QE, + {(char_u *)"\\", (char_u *)0L} +#else + (char_u *)NULL, PV_NONE, + {(char_u *)NULL, (char_u *)0L} +#endif + }, {"readonly", "ro", P_BOOL|P_VI_DEF|P_RSTAT|P_NOGLOB, (char_u *)&p_ro, PV_RO, {(char_u *)FALSE, (char_u *)0L}}, @@ -4375,6 +4401,9 @@ check_buf_options(buf) check_string_option(&buf->b_p_cms); #endif check_string_option(&buf->b_p_nf); +#ifdef FEAT_TEXTOBJ + check_string_option(&buf->b_p_qe); +#endif #ifdef FEAT_SYN_HL check_string_option(&buf->b_p_syn); #endif @@ -4397,6 +4426,9 @@ check_buf_options(buf) #ifdef FEAT_INS_EXPAND check_string_option(&buf->b_p_cpt); #endif +#ifdef FEAT_COMPL_FUNC + check_string_option(&buf->b_p_cfu); +#endif #ifdef FEAT_KEYMAP check_string_option(&buf->b_p_keymap); #endif @@ -5793,6 +5825,7 @@ set_chars_option(varp) { {&lcs_eol, "eol"}, {&lcs_ext, "extends"}, + {&lcs_nbsp, "nbsp"}, {&lcs_prec, "precedes"}, {&lcs_tab2, "tab"}, {&lcs_trail, "trail"}, @@ -7871,6 +7904,9 @@ get_varp(p) #ifdef FEAT_INS_EXPAND case PV_CPT: return (char_u *)&(curbuf->b_p_cpt); #endif +#ifdef FEAT_COMPL_FUNC + case PV_CFU: return (char_u *)&(curbuf->b_p_cfu); +#endif case PV_EOL: return (char_u *)&(curbuf->b_p_eol); case PV_ET: return (char_u *)&(curbuf->b_p_et); #ifdef FEAT_MBYTE @@ -7909,6 +7945,9 @@ get_varp(p) case PV_OFT: return (char_u *)&(curbuf->b_p_oft); #endif case PV_PI: return (char_u *)&(curbuf->b_p_pi); +#ifdef FEAT_TEXTOBJ + case PV_QE: return (char_u *)&(curbuf->b_p_qe); +#endif case PV_RO: return (char_u *)&(curbuf->b_p_ro); #ifdef FEAT_SMARTINDENT case PV_SI: return (char_u *)&(curbuf->b_p_si); @@ -8173,6 +8212,9 @@ buf_copy_options(buf, flags) #ifdef FEAT_INS_EXPAND buf->b_p_cpt = vim_strsave(p_cpt); #endif +#ifdef FEAT_COMPL_FUNC + buf->b_p_cfu = vim_strsave(p_cfu); +#endif buf->b_p_sts = p_sts; buf->b_p_sts_nopaste = p_sts_nopaste; #ifndef SHORT_FNAME @@ -8256,6 +8298,9 @@ buf_copy_options(buf, flags) buf->b_p_dict = empty_option; buf->b_p_tsr = empty_option; #endif +#ifdef FEAT_TEXTOBJ + buf->b_p_qe = vim_strsave(p_qe); +#endif /* * Don't copy the options set by ex_help(), use the saved values, diff --git a/src/os_unix.c b/src/os_unix.c index 597ca3d34..7b9d328f0 100644 --- a/src/os_unix.c +++ b/src/os_unix.c @@ -5391,6 +5391,7 @@ mch_libcall(libname, funcname, argstring, argint, string_result, number_result) { # if defined(USE_DLOPEN) void *hinstLib; + char *dlerr = NULL; # else shl_t hinstLib; # endif @@ -5407,6 +5408,13 @@ mch_libcall(libname, funcname, argstring, argint, string_result, number_result) | RTLD_LOCAL # endif ); + if (hinstLib == NULL) + { + /* "dlerr" must be used before dlclose() */ + dlerr = (char *)dlerror(); + if (dlerr != NULL) + EMSG2(_("dlerror = \"%s\""), dlerr); + } # else hinstLib = shl_load((const char*)libname, BIND_IMMEDIATE|BIND_VERBOSE, 0L); # endif @@ -5423,6 +5431,7 @@ mch_libcall(libname, funcname, argstring, argint, string_result, number_result) if (SETJMP(lc_jump_env) != 0) { success = FALSE; + dlerr = NULL; mch_didjmp(); } else @@ -5435,12 +5444,17 @@ mch_libcall(libname, funcname, argstring, argint, string_result, number_result) { # if defined(USE_DLOPEN) ProcAdd = (STRPROCSTR)dlsym(hinstLib, (const char *)funcname); + dlerr = (char *)dlerror(); # else if (shl_findsym(&hinstLib, (const char *)funcname, TYPE_PROCEDURE, (void *)&ProcAdd) < 0) ProcAdd = NULL; # endif - if ((success = (ProcAdd != NULL))) + if ((success = (ProcAdd != NULL +# if defined(USE_DLOPEN) + && dlerr == NULL +# endif + ))) { if (string_result == NULL) retval_int = ((STRPROCINT)ProcAdd)(argstring); @@ -5452,12 +5466,17 @@ mch_libcall(libname, funcname, argstring, argint, string_result, number_result) { # if defined(USE_DLOPEN) ProcAddI = (INTPROCSTR)dlsym(hinstLib, (const char *)funcname); + dlerr = (char *)dlerror(); # else if (shl_findsym(&hinstLib, (const char *)funcname, TYPE_PROCEDURE, (void *)&ProcAddI) < 0) ProcAddI = NULL; # endif - if ((success = (ProcAddI != NULL))) + if ((success = (ProcAddI != NULL +# if defined(USE_DLOPEN) + && dlerr == NULL +# endif + ))) { if (string_result == NULL) retval_int = ((INTPROCINT)ProcAddI)(argint); @@ -5492,8 +5511,12 @@ mch_libcall(libname, funcname, argstring, argint, string_result, number_result) # endif # endif - /* Free the DLL module. */ # if defined(USE_DLOPEN) + /* "dlerr" must be used before dlclose() */ + if (dlerr != NULL) + EMSG2(_("dlerror = \"%s\""), dlerr); + + /* Free the DLL module. */ (void)dlclose(hinstLib); # else (void)shl_unload(hinstLib); diff --git a/src/proto/search.pro b/src/proto/search.pro index 194c39087..304ad7398 100644 --- a/src/proto/search.pro +++ b/src/proto/search.pro @@ -26,6 +26,7 @@ int current_word __ARGS((oparg_T *oap, long count, int include, int bigword)); int current_sent __ARGS((oparg_T *oap, long count, int include)); int current_block __ARGS((oparg_T *oap, long count, int include, int what, int other)); int current_par __ARGS((oparg_T *oap, long count, int include, int type)); +int current_quote __ARGS((oparg_T *oap, long count, int include, int quotechar)); int linewhite __ARGS((linenr_T lnum)); void find_pattern_in_path __ARGS((char_u *ptr, int dir, int len, int whole, int skip_comments, int type, long count, int action, linenr_T start_lnum, linenr_T end_lnum)); int read_viminfo_search_pattern __ARGS((vir_T *virp, int force)); diff --git a/src/screen.c b/src/screen.c index 8a5b4214b..fa3b5d160 100644 --- a/src/screen.c +++ b/src/screen.c @@ -3549,6 +3549,28 @@ win_line(wp, lnum, startrow, endrow) #endif ++ptr; + /* 'list' : change char 160 to lcs_nbsp. */ + if (wp->w_p_list && c == 160 && lcs_nbsp) + { + c = lcs_nbsp; + if (area_attr == 0 && search_attr == 0) + { + n_attr = 1; + extra_attr = hl_attr(HLF_8); + saved_attr2 = char_attr; /* save current attr */ + } +#ifdef FEAT_MBYTE + mb_c = c; + if (enc_utf8 && (*mb_char2len)(c) > 1) + { + mb_utf8 = TRUE; + u8c_c1 = u8c_c2 = 0; + } + else + mb_utf8 = FALSE; +#endif + } + if (extra_check) { #ifdef FEAT_SYN_HL diff --git a/src/search.c b/src/search.c index ace8fa83c..ddf2feb69 100644 --- a/src/search.c +++ b/src/search.c @@ -3603,7 +3603,269 @@ extend: return OK; } + +static int find_next_quote __ARGS((char_u *top_ptr, int col, int quotechar, char_u *escape)); +static int find_prev_quote __ARGS((char_u *line, int col_start, int quotechar, char_u *escape)); + +/* + * Search quote char from string line[col]. + * Quote character escaped by one of the characters in "escape" is not counted + * as a quote. + * Returns column number of "quotechar" or -1 when not found. + */ + static int +find_next_quote(line, col, quotechar, escape) + char_u *line; + int col; + int quotechar; + char_u *escape; /* escape characters, can be NULL */ +{ + int c; + + while (1) + { + c = line[col]; + if (c == NUL) + return -1; + else if (escape != NULL && vim_strchr(escape, c)) + ++col; + else if (c == quotechar) + break; +#ifdef FEAT_MBYTE + if (has_mbyte) + col += (*mb_ptr2len_check)(line + col); + else +#endif + ++col; + } + return col; +} + +/* + * Search backwards in "line" from column "col_start" to find "quotechar". + * Quote character escaped by one of the characters in "escape" is not counted + * as a quote. + * Return the found column or zero. + */ + static int +find_prev_quote(line, col_start, quotechar, escape) + char_u *line; + int col_start; + int quotechar; + char_u *escape; /* escape characters, can be NULL */ +{ + int n; + + while (col_start > 0) + { + --col_start; +#ifdef FEAT_MBYTE + col_start -= (*mb_head_off)(line, line + col_start); +#endif + n = 0; + if (escape != NULL) + while (col_start - n > 0 && vim_strchr(escape, + line[col_start - n - 1]) != NULL) + ++n; + if (n & 1) + col_start -= n; /* uneven number of escape chars, skip it */ + else if (line[col_start] == quotechar) + break; + } + return col_start; +} + +/* + * Find quote under the cursor, cursor at end. + * Returns TRUE if found, else FALSE. + */ + int +current_quote(oap, count, include, quotechar) + oparg_T *oap; + long count; + int include; /* TRUE == include quote char */ + int quotechar; /* Quote character */ +{ + char_u *line = ml_get_curline(); + int col_end; + int col_start = curwin->w_cursor.col; + int inclusive = FALSE; +#ifdef FEAT_VISUAL + int vis_empty = TRUE; /* Visual selection <= 1 char */ + int vis_bef_curs = FALSE; /* Visual starts before cursor */ + + /* Correct cursor when 'selection' is exclusive */ + if (VIsual_active) + { + if (*p_sel == 'e' && vis_bef_curs) + dec_cursor(); + vis_empty = equalpos(VIsual, curwin->w_cursor); + vis_bef_curs = lt(VIsual, curwin->w_cursor); + } + if (!vis_empty && line[col_start] == quotechar) + { + /* Already selecting something and on a quote character. Find the + * next quoted string. */ + if (vis_bef_curs) + { + /* Assume we are on a closing quote: move to after the next + * opening quote. */ + col_start = find_next_quote(line, col_start + 1, quotechar, NULL); + if (col_start < 0) + return FALSE; + col_end = find_next_quote(line, col_start + 1, quotechar, + curbuf->b_p_qe); + if (col_end < 0) + { + /* We were on a starting quote perhaps? */ + col_end = col_start; + col_start = curwin->w_cursor.col; + } + } + else + { + col_end = find_prev_quote(line, col_start, quotechar, NULL); + if (line[col_end] != quotechar) + return FALSE; + col_start = find_prev_quote(line, col_end, quotechar, + curbuf->b_p_qe); + if (line[col_start] != quotechar) + { + /* We were on an ending quote perhaps? */ + col_start = col_end; + col_end = curwin->w_cursor.col; + } + } + } + else +#endif + + if (line[col_start] == quotechar +#ifdef FEAT_VISUAL + || !vis_empty #endif + ) + { + int first_col = col_start; + +#ifdef FEAT_VISUAL + if (!vis_empty) + { + if (vis_bef_curs) + first_col = find_next_quote(line, col_start, quotechar, NULL); + else + first_col = find_prev_quote(line, col_start, quotechar, NULL); + } +#endif + /* The cursor is on a quote, we don't know if it's the opening or + * closing quote. Search from the start of the line to find out. + * Also do this when there is a Visual area, a' may leave the cursor + * in between two strings. */ + col_start = 0; + while (1) + { + /* Find open quote character. */ + col_start = find_next_quote(line, col_start, quotechar, NULL); + if (col_start < 0 || col_start > first_col) + return FALSE; + /* Find close quote character. */ + col_end = find_next_quote(line, col_start + 1, quotechar, + curbuf->b_p_qe); + if (col_end < 0) + return FALSE; + /* If is cursor between start and end quote character, it is + * target text object. */ + if (col_start <= first_col && first_col <= col_end) + break; + col_start = col_end + 1; + } + } + else + { + /* Search backward for a starting quote. */ + col_start = find_prev_quote(line, col_start, quotechar, curbuf->b_p_qe); + if (line[col_start] != quotechar) + { + /* No quote before the cursor, look after the cursor. */ + col_start = find_next_quote(line, col_start, quotechar, NULL); + if (col_start < 0) + return FALSE; + } + + /* Find close quote character. */ + col_end = find_next_quote(line, col_start + 1, quotechar, + curbuf->b_p_qe); + if (col_end < 0) + return FALSE; + } + + /* When "include" is TRUE, include spaces after closing quote or before + * the starting quote. */ + if (include) + { + if (vim_iswhite(line[col_end + 1])) + while (vim_iswhite(line[col_end + 1])) + ++col_end; + else + while (col_start > 0 && vim_iswhite(line[col_start - 1])) + --col_start; + } + + /* Set start position */ + if (!include) + ++col_start; + curwin->w_cursor.col = col_start; +#ifdef FEAT_VISUAL + if (VIsual_active) + { + if (vis_empty) + { + VIsual = curwin->w_cursor; + redraw_curbuf_later(INVERTED); + } + } + else +#endif + { + oap->start = curwin->w_cursor; + oap->motion_type = MCHAR; + } + + /* Set end position. */ + curwin->w_cursor.col = col_end; + if (include && inc_cursor() == 2) + inclusive = TRUE; +#ifdef FEAT_VISUAL + if (VIsual_active) + { + if (vis_empty || vis_bef_curs) + { + /* decrement cursor when 'selection' is not exclusive */ + if (*p_sel != 'e') + dec_cursor(); + } + else + { + /* Cursor is at start of Visual area. */ + curwin->w_cursor.col = col_start; + } + if (VIsual_mode == 'V') + { + VIsual_mode = 'v'; + redraw_cmdline = TRUE; /* show mode later */ + } + } + else +#endif + { + /* Set inclusive and other oap's flags. */ + oap->inclusive = inclusive; + } + + return OK; +} + +#endif /* FEAT_TEXTOBJ */ #if defined(FEAT_LISP) || defined(FEAT_CINDENT) || defined(FEAT_TEXTOBJ) \ || defined(PROTO) diff --git a/src/structs.h b/src/structs.h index 9e6d4e249..c8c448b95 100644 --- a/src/structs.h +++ b/src/structs.h @@ -1089,6 +1089,9 @@ struct file_buffer #ifdef FEAT_INS_EXPAND char_u *b_p_cpt; /* 'complete' */ #endif +#ifdef FEAT_COMPL_FUNC + char_u *b_p_cfu; /* 'completefunc' */ +#endif int b_p_eol; /* 'endofline' */ int b_p_et; /* 'expandtab' */ int b_p_et_nobin; /* b_p_et saved for binary mode */ @@ -1129,6 +1132,9 @@ struct file_buffer char_u *b_p_oft; /* 'osfiletype' */ #endif int b_p_pi; /* 'preserveindent' */ +#ifdef FEAT_TEXTOBJ + char_u *b_p_qe; /* 'quoteescape' */ +#endif int b_p_ro; /* 'readonly' */ long b_p_sw; /* 'shiftwidth' */ #ifndef SHORT_FNAME diff --git a/src/syntax.c b/src/syntax.c index 31ff7617b..a9cb3fb1e 100644 --- a/src/syntax.c +++ b/src/syntax.c @@ -6021,12 +6021,12 @@ init_highlight(both, reset) } /* - * Load color file "p". + * Load color file "name". * Return OK for success, FAIL for failure. */ int -load_colors(p) - char_u *p; +load_colors(name) + char_u *name; { char_u *buf; int retval = FAIL; @@ -6039,12 +6039,15 @@ load_colors(p) return OK; recursive = TRUE; - buf = alloc((unsigned)(STRLEN(p) + 12)); + buf = alloc((unsigned)(STRLEN(name) + 12)); if (buf != NULL) { - sprintf((char *)buf, "colors/%s.vim", p); + sprintf((char *)buf, "colors/%s.vim", name); retval = cmd_runtime(buf, FALSE); vim_free(buf); +#ifdef FEAT_AUTOCMD + apply_autocmds(EVENT_COLORSCHEME, NULL, NULL, FALSE, curbuf); +#endif } recursive = FALSE; diff --git a/src/testdir/Make_amiga.mak b/src/testdir/Make_amiga.mak index 0970b729f..78a4d276b 100644 --- a/src/testdir/Make_amiga.mak +++ b/src/testdir/Make_amiga.mak @@ -23,7 +23,7 @@ SCRIPTS = test1.out test3.out test4.out test5.out test6.out \ test33.out test34.out test35.out test36.out test37.out \ test38.out test39.out test40.out test41.out test42.out \ test43.out test44.out test45.out test46.out test47.out \ - test48.out test51.out + test48.out test51.out test53.out .SUFFIXES: .in .out @@ -95,3 +95,4 @@ test46.out: test46.in test47.out: test47.in test48.out: test48.in test51.out: test51.in +test53.out: test53.in diff --git a/src/testdir/Make_dos.mak b/src/testdir/Make_dos.mak index b15951e6d..0dd1a09f0 100644 --- a/src/testdir/Make_dos.mak +++ b/src/testdir/Make_dos.mak @@ -17,7 +17,7 @@ SCRIPTS16 = test1.out test19.out test20.out test22.out \ test23.out test24.out test28.out test29.out \ test35.out test36.out test43.out \ test44.out test45.out test46.out test47.out \ - test48.out test51.out + test48.out test51.out test53.out SCRIPTS = test3.out test4.out test5.out test6.out test7.out \ test8.out test9.out test11.out test13.out test14.out \ diff --git a/src/testdir/Make_os2.mak b/src/testdir/Make_os2.mak index af582023a..f3ce50b66 100644 --- a/src/testdir/Make_os2.mak +++ b/src/testdir/Make_os2.mak @@ -23,7 +23,7 @@ SCRIPTS = test1.out test3.out test4.out test5.out test6.out \ test33.out test34.out test35.out test36.out test37.out \ test38.out test39.out test40.out test41.out test42.out \ test43.out test44.out test45.out test46.out test47.out \ - test48.out test51.out + test48.out test51.out test53.out .SUFFIXES: .in .out diff --git a/src/testdir/Make_vms.mms b/src/testdir/Make_vms.mms index 23b0b26fc..6819a68bb 100644 --- a/src/testdir/Make_vms.mms +++ b/src/testdir/Make_vms.mms @@ -4,7 +4,7 @@ # Authors: Zoltan Arpadffy, <arpadffy@polarhome.com> # Sandor Kopanyi, <sandor.kopanyi@mailbox.hu> # -# Last change: 2004 May 03 +# Last change: 2004 Jul 02 # # This has been tested on VMS 6.2 to 7.2 on DEC Alpha and VAX. # Edit the lines in the Configuration section below to select. @@ -57,7 +57,7 @@ SCRIPT = test1.out test2.out test3.out test4.out test5.out \ test33.out test34.out test35.out test36.out test37.out \ test38.out test39.out test40.out test41.out test42.out \ test43.out test44.out test45.out test46.out \ - test48.out test51.out + test48.out test51.out test53.out .IFDEF WANT_GUI SCRIPT_GUI = test16.out diff --git a/src/testdir/Makefile b/src/testdir/Makefile index 7ed97fe21..b09db81ba 100644 --- a/src/testdir/Makefile +++ b/src/testdir/Makefile @@ -13,7 +13,7 @@ SCRIPTS = test1.out test2.out test3.out test4.out test5.out test6.out \ test33.out test34.out test35.out test36.out test37.out \ test38.out test39.out test40.out test41.out test42.out \ test43.out test44.out test45.out test46.out test47.out \ - test48.out test49.out test51.out test52.out + test48.out test49.out test51.out test52.out test53.out SCRIPTS_GUI = test16.out diff --git a/src/testdir/test53.in b/src/testdir/test53.in new file mode 100644 index 000000000..d2c0ad51b --- /dev/null +++ b/src/testdir/test53.in @@ -0,0 +1,24 @@ +Tests for string text objects. vim: set ft=vim : + +STARTTEST +:so small.vim +/^start:/ +da" +0va'a'rx +02f`da` +0fXdi" +03f'vi'ry +:set quoteescape=+*- +di` +$F"va"oha"i"rz +:/^start:/,/^end:/wq! test.out +ENDTEST + +start: "wo\"rd\\" foo +'foo' 'bar' 'piep' +bla bla `quote` blah +out " in "noXno" +"'" 'blah' rep 'buh' +bla `s*`d-`+++`l**` b`la +voo "nah" sdf " asdf" sdf " sdf" sd +end: diff --git a/src/testdir/test53.ok b/src/testdir/test53.ok new file mode 100644 index 000000000..577bad124 --- /dev/null +++ b/src/testdir/test53.ok @@ -0,0 +1,8 @@ +start: foo +xxxxxxxxxxxx'piep' +bla bla blah +out " in "" +"'" 'blah'yyyyy'buh' +bla `` b`la +voo "zzzzzzzzzzzzzzzzzzzzzzzzzzzzsd +end: @@ -1012,6 +1012,7 @@ enum auto_event EVENT_BUFWRITECMD, /* write buffer using command */ EVENT_CMDWINENTER, /* after entering the cmdline window */ EVENT_CMDWINLEAVE, /* before leaving the cmdline window */ + EVENT_COLORSCHEME, /* after loading a colorscheme */ EVENT_FILEAPPENDPOST, /* after appending to a file */ EVENT_FILEAPPENDPRE, /* before appending to a file */ EVENT_FILEAPPENDCMD, /* appende to a file using command */ |