diff options
author | Bram Moolenaar <Bram@vim.org> | 2006-03-26 21:06:50 +0000 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2006-03-26 21:06:50 +0000 |
commit | 899dddf88804af20d560b5277f1ca1bc4dd8e2b3 (patch) | |
tree | 17525001ae02c1e762f4dd6b383612bd16f7238d /src | |
parent | 5c6a2d53232f248c0ba0e4278a447042aa00371e (diff) | |
download | vim-899dddf88804af20d560b5277f1ca1bc4dd8e2b3.zip |
updated for version 7.0b02
Diffstat (limited to 'src')
-rw-r--r-- | src/Makefile | 23 | ||||
-rwxr-xr-x | src/auto/configure | 4 | ||||
-rw-r--r-- | src/buffer.c | 4 | ||||
-rw-r--r-- | src/configure.in | 4 | ||||
-rw-r--r-- | src/eval.c | 33 | ||||
-rw-r--r-- | src/main.aap | 21 | ||||
-rw-r--r-- | src/screen.c | 2 | ||||
-rw-r--r-- | src/spell.c | 256 | ||||
-rw-r--r-- | src/syntax.c | 263 | ||||
-rw-r--r-- | src/testdir/test58.in | 5 | ||||
-rw-r--r-- | src/testdir/test59.in | 5 | ||||
-rw-r--r-- | src/version.h | 4 | ||||
-rw-r--r-- | src/xxd/xxd.c | 5 |
13 files changed, 424 insertions, 205 deletions
diff --git a/src/Makefile b/src/Makefile index 027421431..5ac4cee3c 100644 --- a/src/Makefile +++ b/src/Makefile @@ -354,10 +354,14 @@ CClink = $(CC) # DARWIN - detecting Mac OS X # Uncomment this line when you want to compile a Unix version of Vim on # Darwin. None of the Mac specific options or files will be used. -# You can also change the architecture supported, default is to test for both. #CONF_OPT_DARWIN = --disable-darwin + +# Select the architecture supported. Default is to build for the current +# platform. Use "both" for a universal binary. That probably doesn't work +# when including Perl, Python, etc. #CONF_OPT_DARWIN = --with-mac-arch=i386 #CONF_OPT_DARWIN = --with-mac-arch=ppc +#CONF_OPT_DARWIN = --with-mac-arch=both # PERL # Uncomment this when you want to include the Perl interface. @@ -1318,6 +1322,8 @@ DEST_MAN_FR_U = $(DEST_MAN_TOP)/fr.UTF-8$(MAN1DIR) DEST_MAN_IT = $(DEST_MAN_TOP)/it$(MAN1DIR) DEST_MAN_IT_I = $(DEST_MAN_TOP)/it.ISO8859-1$(MAN1DIR) DEST_MAN_IT_U = $(DEST_MAN_TOP)/it.UTF-8$(MAN1DIR) +DEST_MAN_PL = $(DEST_MAN_TOP)/pl.ISO8859-2$(MAN1DIR) +DEST_MAN_PL_U = $(DEST_MAN_TOP)/pl.UTF-8$(MAN1DIR) DEST_MAN_RU = $(DEST_MAN_TOP)/ru.KOI8-R$(MAN1DIR) DEST_MAN_RU_U = $(DEST_MAN_TOP)/ru.UTF-8$(MAN1DIR) @@ -1897,6 +1903,8 @@ install-tool-languages: -$(SHELL) ./installman.sh xxd $(DEST_MAN_IT) "-it" $(INSTALLMANARGS) -$(SHELL) ./installman.sh xxd $(DEST_MAN_IT_I) "-it" $(INSTALLMANARGS) -$(SHELL) ./installman.sh xxd $(DEST_MAN_IT_U) "-it.UTF-8" $(INSTALLMANARGS) + -$(SHELL) ./installman.sh xxd $(DEST_MAN_PL) "-pl" $(INSTALLMANARGS) + -$(SHELL) ./installman.sh xxd $(DEST_MAN_PL_U) "-pl.UTF-8" $(INSTALLMANARGS) -$(SHELL) ./installman.sh xxd $(DEST_MAN_RU) "-ru" $(INSTALLMANARGS) -$(SHELL) ./installman.sh xxd $(DEST_MAN_RU_U) "-ru.UTF-8" $(INSTALLMANARGS) @@ -1908,6 +1916,8 @@ install-languages: languages $(DEST_LANG) $(DEST_KMAP) -$(SHELL) ./installman.sh install $(DEST_MAN_IT) "-it" $(INSTALLMANARGS) -$(SHELL) ./installman.sh install $(DEST_MAN_IT_I) "-it" $(INSTALLMANARGS) -$(SHELL) ./installman.sh install $(DEST_MAN_IT_U) "-it.UTF-8" $(INSTALLMANARGS) + -$(SHELL) ./installman.sh install $(DEST_MAN_PL) "-pl" $(INSTALLMANARGS) + -$(SHELL) ./installman.sh install $(DEST_MAN_PL_U) "-pl.UTF-8" $(INSTALLMANARGS) -$(SHELL) ./installman.sh install $(DEST_MAN_RU) "-ru" $(INSTALLMANARGS) -$(SHELL) ./installman.sh install $(DEST_MAN_RU_U) "-ru.UTF-8" $(INSTALLMANARGS) -$(SHELL) ./installml.sh install "$(GUI_MAN_TARGETS)" \ @@ -1923,6 +1933,10 @@ install-languages: languages $(DEST_LANG) $(DEST_KMAP) -$(SHELL) ./installml.sh install "$(GUI_MAN_TARGETS)" \ $(DEST_MAN_IT_U) $(INSTALLMLARGS) -$(SHELL) ./installml.sh install "$(GUI_MAN_TARGETS)" \ + $(DEST_MAN_PL) $(INSTALLMLARGS) + -$(SHELL) ./installml.sh install "$(GUI_MAN_TARGETS)" \ + $(DEST_MAN_PL_U) $(INSTALLMLARGS) + -$(SHELL) ./installml.sh install "$(GUI_MAN_TARGETS)" \ $(DEST_MAN_RU) $(INSTALLMLARGS) -$(SHELL) ./installml.sh install "$(GUI_MAN_TARGETS)" \ $(DEST_MAN_RU_U) $(INSTALLMLARGS) @@ -2061,6 +2075,8 @@ uninstall_runtime: -$(SHELL) ./installman.sh uninstall $(DEST_MAN_IT) "" $(INSTALLMANARGS) -$(SHELL) ./installman.sh uninstall $(DEST_MAN_IT_I) "" $(INSTALLMANARGS) -$(SHELL) ./installman.sh uninstall $(DEST_MAN_IT_U) "" $(INSTALLMANARGS) + -$(SHELL) ./installman.sh uninstall $(DEST_MAN_PL) "" $(INSTALLMANARGS) + -$(SHELL) ./installman.sh uninstall $(DEST_MAN_PL_U) "" $(INSTALLMANARGS) -$(SHELL) ./installman.sh uninstall $(DEST_MAN_RU) "" $(INSTALLMANARGS) -$(SHELL) ./installman.sh uninstall $(DEST_MAN_RU_U) "" $(INSTALLMANARGS) -$(SHELL) ./installml.sh uninstall "$(GUI_MAN_TARGETS)" \ @@ -2078,12 +2094,17 @@ uninstall_runtime: -$(SHELL) ./installml.sh uninstall "$(GUI_MAN_TARGETS)" \ $(DEST_MAN_IT_U) $(INSTALLMLARGS) -$(SHELL) ./installml.sh uninstall "$(GUI_MAN_TARGETS)" \ + $(DEST_MAN_PL) $(INSTALLMLARGS) + -$(SHELL) ./installml.sh uninstall "$(GUI_MAN_TARGETS)" \ + $(DEST_MAN_PL_U) $(INSTALLMLARGS) + -$(SHELL) ./installml.sh uninstall "$(GUI_MAN_TARGETS)" \ $(DEST_MAN_RU) $(INSTALLMLARGS) -$(SHELL) ./installml.sh uninstall "$(GUI_MAN_TARGETS)" \ $(DEST_MAN_RU_U) $(INSTALLMLARGS) -rm -f $(DEST_MAN)/xxd.1 -rm -f $(DEST_MAN_FR)/xxd.1 $(DEST_MAN_FR_I)/xxd.1 $(DEST_MAN_FR_U)/xxd.1 -rm -f $(DEST_MAN_IT)/xxd.1 $(DEST_MAN_IT_I)/xxd.1 $(DEST_MAN_IT_U)/xxd.1 + -rm -f $(DEST_MAN_PL)/xxd.1 $(DEST_MAN_PL_U)/xxd.1 -rm -f $(DEST_MAN_RU)/xxd.1 $(DEST_MAN_RU_U)/xxd.1 -rm -f $(DEST_HELP)/*.txt $(DEST_HELP)/tags $(DEST_HELP)/*.pl -rm -f $(DEST_HELP)/*.??x $(DEST_HELP)/tags-?? diff --git a/src/auto/configure b/src/auto/configure index 22f724eaa..f1178f88e 100755 --- a/src/auto/configure +++ b/src/auto/configure @@ -876,7 +876,7 @@ Optional Features: Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) - --with-mac-arch=ARCH intel, ppc or both + --with-mac-arch=ARCH current, intel, ppc or both --with-vim-name=NAME what to call the Vim executable --with-ex-name=NAME what to call the Ex executable --with-view-name=NAME what to call the View executable @@ -2874,7 +2874,7 @@ if test "${with_mac_arch+set}" = set; then MACARCH="$withval"; echo "$as_me:$LINENO: result: $MACARCH" >&5 echo "${ECHO_T}$MACARCH" >&6 else - MACARCH="both"; echo "$as_me:$LINENO: result: defaulting to $MACARCH" >&5 + MACARCH="current"; echo "$as_me:$LINENO: result: defaulting to $MACARCH" >&5 echo "${ECHO_T}defaulting to $MACARCH" >&6 fi; diff --git a/src/buffer.c b/src/buffer.c index 37238636b..439b5f2b6 100644 --- a/src/buffer.c +++ b/src/buffer.c @@ -3707,7 +3707,7 @@ build_stl_str_hl(wp, out, outlen, fmt, use_sandbox, fillchar, maxwidth, hltab, t itemisflag = TRUE; if (wp->w_buffer->b_help) str = (char_u *)((opt == STL_HELPFLAG_ALT) ? ",HLP" - : _("[help]")); + : _("[Help]")); break; #ifdef FEAT_AUTOCMD @@ -4975,7 +4975,7 @@ buf_spname(buf) if (win != NULL && win->w_llist_ref != NULL) return _("[Location List]"); else - return _("[Error List]"); + return _("[Quickfix List]"); } #endif #ifdef FEAT_QUICKFIX diff --git a/src/configure.in b/src/configure.in index f7648a882..2568fc37f 100644 --- a/src/configure.in +++ b/src/configure.in @@ -103,9 +103,9 @@ if test "`(uname) 2>/dev/null`" = Darwin; then fi AC_MSG_CHECKING(--with-mac-arch argument) - AC_ARG_WITH(mac-arch, [ --with-mac-arch=ARCH intel, ppc or both], + AC_ARG_WITH(mac-arch, [ --with-mac-arch=ARCH current, intel, ppc or both], MACARCH="$withval"; AC_MSG_RESULT($MACARCH), - MACARCH="both"; AC_MSG_RESULT(defaulting to $MACARCH)) + MACARCH="current"; AC_MSG_RESULT(defaulting to $MACARCH)) if test "x$MACARCH" = "xboth"; then AC_MSG_CHECKING(for 10.4 universal SDK) diff --git a/src/eval.c b/src/eval.c index e80407e68..63abcbae2 100644 --- a/src/eval.c +++ b/src/eval.c @@ -8964,42 +8964,54 @@ findfilendir(argvars, rettv, dir) char_u pathbuf[NUMBUFLEN]; int count = 1; int first = TRUE; + int error = FALSE; +#endif + rettv->vval.v_string = NULL; + rettv->v_type = VAR_STRING; + +#ifdef FEAT_SEARCHPATH fname = get_tv_string(&argvars[0]); if (argvars[1].v_type != VAR_UNKNOWN) { p = get_tv_string_buf_chk(&argvars[1], pathbuf); if (p == NULL) - count = -1; /* error */ + error = TRUE; else { if (*p != NUL) path = p; if (argvars[2].v_type != VAR_UNKNOWN) - count = get_tv_number_chk(&argvars[2], NULL); /* -1: error */ + count = get_tv_number_chk(&argvars[2], &error); } } - if (*fname != NUL && count >= 0) + if (count < 0 && rettv_list_alloc(rettv) == FAIL) + error = TRUE; + + if (*fname != NUL && !error) { do { - vim_free(fresult); + if (rettv->v_type == VAR_STRING) + vim_free(fresult); fresult = find_file_in_path_option(first ? fname : NULL, first ? (int)STRLEN(fname) : 0, 0, first, path, dir, NULL, dir ? (char_u *)"" : curbuf->b_p_sua); first = FALSE; - } while (--count > 0 && fresult != NULL); + + if (fresult != NULL && rettv->v_type == VAR_LIST) + list_append_string(rettv->vval.v_list, fresult, -1); + + } while ((rettv->v_type == VAR_LIST || --count > 0) && fresult != NULL); } - rettv->vval.v_string = fresult; -#else - rettv->vval.v_string = NULL; + if (rettv->v_type == VAR_STRING) + rettv->vval.v_string = fresult; #endif - rettv->v_type = VAR_STRING; } static void filter_map __ARGS((typval_T *argvars, typval_T *rettv, int map)); @@ -18673,8 +18685,9 @@ trans_function_name(pp, skip, flags, fdp) else if (lead > 0) { lead = 3; - if (eval_fname_sid(*pp)) /* If it's "<SID>" */ + if (eval_fname_sid(lv.ll_exp_name != NULL ? lv.ll_exp_name : *pp)) { + /* It's "s:" or "<SID>" */ if (current_SID <= 0) { EMSG(_(e_usingsid)); diff --git a/src/main.aap b/src/main.aap index fa7917b50..a4de631c0 100644 --- a/src/main.aap +++ b/src/main.aap @@ -658,6 +658,8 @@ DEST_MAN_FR_U = $(DEST_MAN_TOP)/fr.UTF-8$(MAN1DIR) DEST_MAN_IT = $(DEST_MAN_TOP)/it$(MAN1DIR) DEST_MAN_IT_I = $(DEST_MAN_TOP)/it.ISO8859-1$(MAN1DIR) DEST_MAN_IT_U = $(DEST_MAN_TOP)/it.UTF-8$(MAN1DIR) +DEST_MAN_PL = $(DEST_MAN_TOP)/pl.ISO8859-2$(MAN1DIR) +DEST_MAN_PL_U = $(DEST_MAN_TOP)/pl.UTF-8$(MAN1DIR) DEST_MAN_RU = $(DEST_MAN_TOP)/ru.KOI8-R$(MAN1DIR) DEST_MAN_RU_U = $(DEST_MAN_TOP)/ru.UTF-8$(MAN1DIR) @@ -667,7 +669,9 @@ DEST_MAN_RU_U = $(DEST_MAN_TOP)/ru.UTF-8$(MAN1DIR) $DEST_COMP $DEST_KMAP $DEST_MACRO $DEST_TOOLS $DEST_TUTOR $DEST_SCRIPT $DEST_PRINT $DEST_MAN $DEST_SPELL $DEST_MAN_FR $DEST_MAN_FR_I $DEST_MAN_FR_U $DEST_MAN_IT - $DEST_MAN_IT_I $DEST_MAN_IT_U $DEST_MAN_RU $DEST_MAN_RU_U + $DEST_MAN_IT_I $DEST_MAN_IT_U + $DEST_MAN_PL $DEST_MAN_PL_U + $DEST_MAN_RU $DEST_MAN_RU_U # # I N S T A L L @@ -893,6 +897,8 @@ install-tool-languages: :sys ./installman.sh xxd $(DEST_MAN_IT) "-it" $(INSTALLMANARGS) :sys ./installman.sh xxd $(DEST_MAN_IT_I) "-it" $(INSTALLMANARGS) :sys ./installman.sh xxd $(DEST_MAN_IT_U) "-it.UTF-8" $(INSTALLMANARGS) + :sys ./installman.sh xxd $(DEST_MAN_PL) "-pl" $(INSTALLMANARGS) + :sys ./installman.sh xxd $(DEST_MAN_PL_U) "-pl.UTF-8" $(INSTALLMANARGS) :sys ./installman.sh xxd $(DEST_MAN_RU) "-ru" $(INSTALLMANARGS) :sys ./installman.sh xxd $(DEST_MAN_RU_U) "-ru.UTF-8" $(INSTALLMANARGS) @@ -904,6 +910,8 @@ install-languages {virtual}{force}: languages $DEST_LANG $DEST_KMAP :sys ./installman.sh install $(DEST_MAN_IT) "-it" $(INSTALLMANARGS) :sys ./installman.sh install $(DEST_MAN_IT_I) "-it" $(INSTALLMANARGS) :sys ./installman.sh install $(DEST_MAN_IT_U) "-it.UTF-8" $(INSTALLMANARGS) + :sys ./installman.sh install $(DEST_MAN_PL) "-pl" $(INSTALLMANARGS) + :sys ./installman.sh install $(DEST_MAN_PL_U) "-pl.UTF-8" $(INSTALLMANARGS) :sys ./installman.sh install $(DEST_MAN_RU) "-ru" $(INSTALLMANARGS) :sys ./installman.sh install $(DEST_MAN_RU_U) "-ru.UTF-8" $(INSTALLMANARGS) :sys ./installml.sh install "$(GUI_MAN_TARGETS)" \ @@ -919,6 +927,10 @@ install-languages {virtual}{force}: languages $DEST_LANG $DEST_KMAP :sys ./installml.sh install "$(GUI_MAN_TARGETS)" \ $(DEST_MAN_IT_U) $(INSTALLMLARGS) :sys ./installml.sh install "$(GUI_MAN_TARGETS)" \ + $(DEST_MAN_PL) $(INSTALLMLARGS) + :sys ./installml.sh install "$(GUI_MAN_TARGETS)" \ + $(DEST_MAN_PL_U) $(INSTALLMLARGS) + :sys ./installml.sh install "$(GUI_MAN_TARGETS)" \ $(DEST_MAN_RU) $(INSTALLMLARGS) :sys ./installml.sh install "$(GUI_MAN_TARGETS)" \ $(DEST_MAN_RU_U) $(INSTALLMLARGS) @@ -1049,6 +1061,8 @@ uninstall_runtime {virtual}{force}: :sys ./installman.sh uninstall $(DEST_MAN_IT) "" $(INSTALLMANARGS) :sys ./installman.sh uninstall $(DEST_MAN_IT_I) "" $(INSTALLMANARGS) :sys ./installman.sh uninstall $(DEST_MAN_IT_U) "" $(INSTALLMANARGS) + :sys ./installman.sh uninstall $(DEST_MAN_PL) "" $(INSTALLMANARGS) + :sys ./installman.sh uninstall $(DEST_MAN_PL_U) "" $(INSTALLMANARGS) :sys ./installman.sh uninstall $(DEST_MAN_RU) "" $(INSTALLMANARGS) :sys ./installman.sh uninstall $(DEST_MAN_RU_U) "" $(INSTALLMANARGS) :sys ./installml.sh uninstall "$(GUI_MAN_TARGETS)" \ @@ -1066,12 +1080,17 @@ uninstall_runtime {virtual}{force}: :sys ./installml.sh uninstall "$(GUI_MAN_TARGETS)" \ $(DEST_MAN_IT_U) $(INSTALLMLARGS) :sys ./installml.sh uninstall "$(GUI_MAN_TARGETS)" \ + $(DEST_MAN_PL) $(INSTALLMLARGS) + :sys ./installml.sh uninstall "$(GUI_MAN_TARGETS)" \ + $(DEST_MAN_PL_U) $(INSTALLMLARGS) + :sys ./installml.sh uninstall "$(GUI_MAN_TARGETS)" \ $(DEST_MAN_RU) $(INSTALLMLARGS) :sys ./installml.sh uninstall "$(GUI_MAN_TARGETS)" \ $(DEST_MAN_RU_U) $(INSTALLMLARGS) :del {force} $DEST_MAN/xxd.1 :del {force} $(DEST_MAN_FR)/xxd.1 $(DEST_MAN_FR_I)/xxd.1 $(DEST_MAN_FR_U)/xxd.1 :del {force} $(DEST_MAN_IT)/xxd.1 $(DEST_MAN_IT_I)/xxd.1 $(DEST_MAN_IT_U)/xxd.1 + :del {force} $(DEST_MAN_PL)/xxd.1 $(DEST_MAN_PL_U)/xxd.1 :del {force} $(DEST_MAN_RU)/xxd.1 $(DEST_MAN_RU_U)/xxd.1 :del {force} $DEST_HELP/*.txt $DEST_HELP/tags $DEST_HELP/*.pl diff --git a/src/screen.c b/src/screen.c index 0e8b86778..60ffe9930 100644 --- a/src/screen.c +++ b/src/screen.c @@ -5528,7 +5528,7 @@ win_redr_status(wp) *(p + len++) = ' '; if (wp->w_buffer->b_help) { - STRCPY(p + len, _("[help]")); + STRCPY(p + len, _("[Help]")); len += (int)STRLEN(p + len); } #ifdef FEAT_QUICKFIX diff --git a/src/spell.c b/src/spell.c index 4a65aeeaa..c2bf58d01 100644 --- a/src/spell.c +++ b/src/spell.c @@ -185,14 +185,21 @@ * <mapstr> N bytes String with sequences of similar characters, * separated by slashes. * - * sectionID == SN_COMPOUND: <compmax> <compminlen> <compsylmax> <compflags> + * sectionID == SN_COMPOUND: <compmax> <compminlen> <compsylmax> <compoptions> + * <comppatcount> <comppattern> ... <compflags> * <compmax> 1 byte Maximum nr of words in compound word. * <compminlen> 1 byte Minimal word length for compounding. * <compsylmax> 1 byte Maximum nr of syllables in compound word. + * <compoptions> 2 bytes COMP_ flags. + * <comppatcount> 2 bytes number of <comppattern> following * <compflags> N bytes Flags from COMPOUNDRULE items, separated by * slashes. * - * sectionID == SN_NOBREAK: (empty, its presence is enough) + * <comppattern>: <comppatlen> <comppattext> + * <comppatlen> 1 byte length of <comppattext> + * <comppattext> N bytes end or begin chars from CHECKCOMPOUNDPATTERN + * + * sectionID == SN_NOBREAK: (empty, its presence is what matters) * * sectionID == SN_SYLLABLE: <syllable> * <syllable> N bytes String from SYLLABLE item. @@ -248,6 +255,7 @@ * WF_HAS_AFF >> 8 word includes affix * WF_NEEDCOMP >> 8 word only valid in compound * WF_NOSUGGEST >> 8 word not used for suggestions + * WF_COMPROOT >> 8 word already a compound * * <pflags> 1 byte bitmask of: * WFP_RARE rare prefix @@ -336,6 +344,7 @@ typedef long idx_T; #define WF_HAS_AFF 0x0100 /* word includes affix */ #define WF_NEEDCOMP 0x0200 /* word only valid in compound */ #define WF_NOSUGGEST 0x0400 /* word not to be suggested */ +#define WF_COMPROOT 0x0800 /* already compounded word, COMPOUNDROOT */ /* only used for su_badflags */ #define WF_MIXCAP 0x20 /* mix of upper and lower case: macaRONI */ @@ -356,6 +365,12 @@ typedef long idx_T; #define WF_PFX_UP (WFP_UP << 24) /* in sl_pidxs: flag for to-upper * postponed prefix */ +/* flags for <compoptions> */ +#define COMP_CHECKDUP 1 /* CHECKCOMPOUNDDUP */ +#define COMP_CHECKREP 2 /* CHECKCOMPOUNDREP */ +#define COMP_CHECKCASE 4 /* CHECKCOMPOUNDCASE */ +#define COMP_CHECKTRIPLE 8 /* CHECKCOMPOUNDTRIPLE */ + /* Special byte values for <byte>. Some are only used in the tree for * postponed prefixes, some only in the other trees. This is a bit messy... */ #define BY_NOFLAGS 0 /* end of word without flags or region; for @@ -443,9 +458,11 @@ struct slang_S hashtab_T sl_wordcount; /* hashtable with word count, wordcount_T */ - int sl_compmax; /* COMPOUNDMAX (default: MAXWLEN) */ + int sl_compmax; /* COMPOUNDWORDMAX (default: MAXWLEN) */ int sl_compminlen; /* COMPOUNDMIN (default: 0) */ int sl_compsylmax; /* COMPOUNDSYLMAX (default: MAXWLEN) */ + int sl_compoptions; /* COMP_* flags */ + garray_T sl_comppat; /* CHECKCOMPOUNDPATTERN items */ regprog_T *sl_compprog; /* COMPOUNDRULE turned into a regexp progrm * (NULL when no compounding) */ char_u *sl_compstartflags; /* flags for first compound word */ @@ -693,6 +710,7 @@ typedef struct matchinf_S int mi_compoff; /* start of following word offset */ char_u mi_compflags[MAXWLEN]; /* flags for compound words used */ int mi_complen; /* nr of compound words used */ + int mi_compextra; /* nr of COMPOUNDROOT words */ /* others */ int mi_result; /* result so far: SP_BAD, SP_OK, etc. */ @@ -1475,9 +1493,10 @@ find_word(mip, mode) continue; #endif - /* Limit the number of compound words to COMPOUNDMAX if no + /* Limit the number of compound words to COMPOUNDWORDMAX if no * maximum for syllables is specified. */ - if (!word_ends && mip->mi_complen + 2 > slang->sl_compmax + if (!word_ends && mip->mi_complen + mip->mi_compextra + 2 + > slang->sl_compmax && slang->sl_compsylmax == MAXWLEN) continue; @@ -1589,6 +1608,8 @@ find_word(mip, mode) #endif c = mip->mi_compoff; ++mip->mi_complen; + if (flags & WF_COMPROOT) + ++mip->mi_compextra; /* For NOBREAK we need to try all NOBREAK languages, at least * to find the ".add" file(s). */ @@ -1625,6 +1646,8 @@ find_word(mip, mode) break; } --mip->mi_complen; + if (flags & WF_COMPROOT) + --mip->mi_compextra; mip->mi_lp = save_lp; if (slang->sl_nobreak) @@ -1726,7 +1749,7 @@ can_compound(slang, word, flags) /* Count the number of syllables. This may be slow, do it last. If there * are too many syllables AND the number of compound words is above - * COMPOUNDMAX then compounding is not allowed. */ + * COMPOUNDWORDMAX then compounding is not allowed. */ if (slang->sl_compsylmax < MAXWLEN && count_syllables(slang, word) > slang->sl_compsylmax) return (int)STRLEN(flags) < slang->sl_compmax; @@ -2465,6 +2488,8 @@ slang_clear(lp) lp->sl_syllable = NULL; ga_clear(&lp->sl_syl_items); + ga_clear_strings(&lp->sl_comppat); + hash_clear_all(&lp->sl_wordcount, WC_KEY_OFF); hash_init(&lp->sl_wordcount); @@ -3371,7 +3396,7 @@ read_sofo_section(fd, slang) /* * Read the compound section from the .spl file: - * <compmax> <compminlen> <compsylmax> <compflags> + * <compmax> <compminlen> <compsylmax> <compoptions> <compflags> * Returns SP_*ERROR flags. */ static int @@ -3387,6 +3412,8 @@ read_compound(fd, slang, len) char_u *pp; char_u *cp; char_u *ap; + int cnt; + garray_T *gap; if (todo < 2) return SP_FORMERROR; /* need at least two bytes */ @@ -3409,6 +3436,32 @@ read_compound(fd, slang, len) c = MAXWLEN; slang->sl_compsylmax = c; + c = getc(fd); /* <compoptions> */ + if (c != 0) + ungetc(c, fd); /* be backwards compatible with Vim 7.0b */ + else + { + --todo; + c = getc(fd); /* only use the lower byte for now */ + --todo; + slang->sl_compoptions = c; + + gap = &slang->sl_comppat; + c = get2c(fd); /* <comppatcount> */ + todo -= 2; + ga_init2(gap, sizeof(char_u *), c); + if (ga_grow(gap, c) == OK) + while (--c >= 0) + { + ((char_u **)(gap->ga_data))[gap->ga_len++] = + read_cnt_string(fd, 1, &cnt); + /* <comppatlen> <comppattext> */ + if (cnt < 0) + return cnt; + todo -= cnt + 2; + } + } + /* Turn the COMPOUNDRULE items into a regexp pattern: * "a[bc]/a*b+" -> "^\(a[bc]\|a*b\+\)$". * Inserting backslashes may double the length, "^\(\)$<Nul>" is 7 bytes. @@ -4588,8 +4641,12 @@ typedef struct afffile_S unsigned af_bad; /* BAD ID for banned word */ unsigned af_needaffix; /* NEEDAFFIX ID */ unsigned af_needcomp; /* NEEDCOMPOUND ID */ + unsigned af_comproot; /* COMPOUNDROOT ID */ + unsigned af_compforbid; /* COMPOUNDFORBIDFLAG ID */ + unsigned af_comppermit; /* COMPOUNDPERMITFLAG ID */ unsigned af_nosuggest; /* NOSUGGEST ID */ - int af_pfxpostpone; /* postpone prefixes without chop string */ + int af_pfxpostpone; /* postpone prefixes without chop string and + without flags */ hashtab_T af_pref; /* hashtable for prefixes, affheader_T */ hashtab_T af_suff; /* hashtable for suffixes, affheader_T */ hashtab_T af_comp; /* hashtable for compound flags, compitem_T */ @@ -4607,9 +4664,9 @@ struct affentry_S affentry_T *ae_next; /* next affix with same name/number */ char_u *ae_chop; /* text to chop off basic word (can be NULL) */ char_u *ae_add; /* text to add to basic word (can be NULL) */ + char_u *ae_flags; /* flags on the affix (can be NULL) */ char_u *ae_cond; /* condition (NULL for ".") */ regprog_T *ae_prog; /* regexp program for ae_cond or NULL */ - char_u ae_rare; /* rare affix */ char_u ae_nocomp; /* word with affix not compoundable */ }; @@ -4757,6 +4814,9 @@ typedef struct spellinfo_S int si_compmax; /* max nr of words for compounding */ int si_compminlen; /* minimal length for compounding */ int si_compsylmax; /* max nr of syllables for compounding */ + int si_compoptions; /* COMP_ flags */ + garray_T si_comppat; /* CHECKCOMPOUNDPATTERN items, each stored as + a string */ char_u *si_compflags; /* flags used for compounding */ char_u si_nobreak; /* NOBREAK */ char_u *si_syllable; /* syllable string */ @@ -4960,7 +5020,8 @@ spell_read_aff(spin, fname) int l; int compminlen = 0; /* COMPOUNDMIN value */ int compsylmax = 0; /* COMPOUNDSYLMAX value */ - int compmax = 0; /* COMPOUNDMAX value */ + int compoptions = 0; /* COMP_ flags */ + int compmax = 0; /* COMPOUNDWORDMAX value */ char_u *compflags = NULL; /* COMPOUNDFLAG and COMPOUNDRULE concatenated */ char_u *midword = NULL; /* MIDWORD value */ @@ -5096,6 +5157,7 @@ spell_read_aff(spin, fname) || aff->af_bad != 0 || aff->af_needaffix != 0 || aff->af_needcomp != 0 + || aff->af_comproot != 0 || aff->af_nosuggest != 0 || compflags != NULL || aff->af_suff.ht_used > 0 @@ -5171,6 +5233,24 @@ spell_read_aff(spin, fname) aff->af_needcomp = affitem2flag(aff->af_flagtype, items[1], fname, lnum); } + else if (STRCMP(items[0], "COMPOUNDROOT") == 0 && itemcnt == 2 + && aff->af_comproot == 0) + { + aff->af_comproot = affitem2flag(aff->af_flagtype, items[1], + fname, lnum); + } + else if (STRCMP(items[0], "COMPOUNDFORBIDFLAG") == 0 + && itemcnt == 2 && aff->af_compforbid == 0) + { + aff->af_compforbid = affitem2flag(aff->af_flagtype, items[1], + fname, lnum); + } + else if (STRCMP(items[0], "COMPOUNDPERMITFLAG") == 0 + && itemcnt == 2 && aff->af_comppermit == 0) + { + aff->af_comppermit = affitem2flag(aff->af_flagtype, items[1], + fname, lnum); + } else if (STRCMP(items[0], "COMPOUNDFLAG") == 0 && itemcnt == 2 && compflags == NULL) { @@ -5203,12 +5283,12 @@ spell_read_aff(spin, fname) compflags = p; } } - else if (STRCMP(items[0], "COMPOUNDMAX") == 0 && itemcnt == 2 + else if (STRCMP(items[0], "COMPOUNDWORDMAX") == 0 && itemcnt == 2 && compmax == 0) { compmax = atoi((char *)items[1]); if (compmax == 0) - smsg((char_u *)_("Wrong COMPOUNDMAX value in %s line %d: %s"), + smsg((char_u *)_("Wrong COMPOUNDWORDMAX value in %s line %d: %s"), fname, lnum, items[1]); } else if (STRCMP(items[0], "COMPOUNDMIN") == 0 && itemcnt == 2 @@ -5227,6 +5307,50 @@ spell_read_aff(spin, fname) smsg((char_u *)_("Wrong COMPOUNDSYLMAX value in %s line %d: %s"), fname, lnum, items[1]); } + else if (STRCMP(items[0], "CHECKCOMPOUNDDUP") == 0 && itemcnt == 1) + { + compoptions |= COMP_CHECKDUP; + } + else if (STRCMP(items[0], "CHECKCOMPOUNDREP") == 0 && itemcnt == 1) + { + compoptions |= COMP_CHECKREP; + } + else if (STRCMP(items[0], "CHECKCOMPOUNDCASE") == 0 && itemcnt == 1) + { + compoptions |= COMP_CHECKCASE; + } + else if (STRCMP(items[0], "CHECKCOMPOUNDTRIPLE") == 0 + && itemcnt == 1) + { + compoptions |= COMP_CHECKTRIPLE; + } + else if (STRCMP(items[0], "CHECKCOMPOUNDPATTERN") == 0 + && itemcnt == 2) + { + if (atoi((char *)items[1]) == 0) + smsg((char_u *)_("Wrong CHECKCOMPOUNDPATTERN value in %s line %d: %s"), + fname, lnum, items[1]); + } + else if (STRCMP(items[0], "CHECKCOMPOUNDPATTERN") == 0 + && itemcnt == 3) + { + garray_T *gap = &spin->si_comppat; + int i; + + /* Only add the couple if it isn't already there. */ + for (i = 0; i < gap->ga_len - 1; i += 2) + if (STRCMP(((char_u **)(gap->ga_data))[i], items[1]) == 0 + && STRCMP(((char_u **)(gap->ga_data))[i + 1], + items[2]) == 0) + break; + if (i >= gap->ga_len && ga_grow(gap, 2) == OK) + { + ((char_u **)(gap->ga_data))[gap->ga_len++] + = getroom_save(spin, items[1]); + ((char_u **)(gap->ga_data))[gap->ga_len++] + = getroom_save(spin, items[2]); + } + } else if (STRCMP(items[0], "SYLLABLE") == 0 && itemcnt == 2 && syllable == NULL) { @@ -5293,7 +5417,8 @@ spell_read_aff(spin, fname) || cur_aff->ah_flag == aff->af_keepcase || cur_aff->ah_flag == aff->af_needaffix || cur_aff->ah_flag == aff->af_nosuggest - || cur_aff->ah_flag == aff->af_needcomp) + || cur_aff->ah_flag == aff->af_needcomp + || cur_aff->ah_flag == aff->af_comproot) smsg((char_u *)_("Affix also used for BAD/RARE/KEEPCASE/NEEDAFFIX/NEEDCOMPOUND/NOSUGGEST in %s line %d: %s"), fname, lnum, items[1]); STRCPY(cur_aff->ah_key, items[1]); @@ -5315,8 +5440,7 @@ spell_read_aff(spin, fname) /* Myspell allows extra text after the item, but that might * mean mistakes go unnoticed. Require a comment-starter. */ if (itemcnt > lasti && *items[lasti] != '#') - smsg((char_u *)_("Trailing text in %s line %d: %s"), - fname, lnum, items[4]); + smsg((char_u *)_(e_afftrailing), fname, lnum, items[lasti]); if (STRCMP(items[2], "Y") != 0 && STRCMP(items[2], "N") != 0) smsg((char_u *)_("Expected Y or N in %s line %d: %s"), @@ -5350,31 +5474,16 @@ spell_read_aff(spin, fname) && itemcnt >= 5) { affentry_T *aff_entry; - int rare = FALSE; int nocomp = FALSE; int upper = FALSE; int lasti = 5; - /* Check for "rare" and "nocomp" after the other info. */ - while (itemcnt > lasti) - { - if (!rare && STRICMP(items[lasti], "rare") == 0) - { - rare = TRUE; - ++lasti; - } - else if (!nocomp && STRICMP(items[lasti], "nocomp") == 0) - { - nocomp = TRUE; - ++lasti; - } - else - break; - } - /* Myspell allows extra text after the item, but that might - * mean mistakes go unnoticed. Require a comment-starter. */ - if (itemcnt > lasti && *items[lasti] != '#') + * mean mistakes go unnoticed. Require a comment-starter. + * Hunspell uses a "-" item. */ + if (itemcnt > lasti && *items[lasti] != '#' + && (STRCMP(items[lasti], "-") != 0 + || itemcnt != lasti + 1)) smsg((char_u *)_(e_afftrailing), fname, lnum, items[lasti]); /* New item for an affix letter. */ @@ -5383,14 +5492,20 @@ spell_read_aff(spin, fname) sizeof(affentry_T), TRUE); if (aff_entry == NULL) break; - aff_entry->ae_rare = rare; aff_entry->ae_nocomp = nocomp; if (STRCMP(items[2], "0") != 0) aff_entry->ae_chop = getroom_save(spin, items[2]); if (STRCMP(items[3], "0") != 0) + { aff_entry->ae_add = getroom_save(spin, items[3]); + /* Recognize flags on the affix: abcd/1234 */ + aff_entry->ae_flags = vim_strchr(aff_entry->ae_add, '/'); + if (aff_entry->ae_flags != NULL) + *aff_entry->ae_flags++ = NUL; + } + /* Don't use an affix entry with non-ASCII characters when * "spin->si_ascii" is TRUE. */ if (!spin->si_ascii || !(has_non_ascii(aff_entry->ae_chop) @@ -5416,8 +5531,10 @@ spell_read_aff(spin, fname) } /* For postponed prefixes we need an entry in si_prefcond - * for the condition. Use an existing one if possible. */ - if (*items[0] == 'P' && aff->af_pfxpostpone) + * for the condition. Use an existing one if possible. + * Can't be done for an affix with flags. */ + if (*items[0] == 'P' && aff->af_pfxpostpone + && aff_entry->ae_flags == NULL) { /* When the chop string is one lower-case letter and * the add string ends in the upper-case letter we set @@ -5480,7 +5597,8 @@ spell_read_aff(spin, fname) } } - if (aff_entry->ae_chop == NULL) + if (aff_entry->ae_chop == NULL + && aff_entry->ae_flags == NULL) { int idx; char_u **pp; @@ -5507,16 +5625,19 @@ spell_read_aff(spin, fname) aff_entry->ae_cond); } + if (aff_entry->ae_flags != NULL) + smsg((char_u *)_("Affix flags ignored when PFXPOSTPONE used in %s line %d: %s"), + fname, lnum, items[4]); + /* Add the prefix to the prefix tree. */ if (aff_entry->ae_add == NULL) p = (char_u *)""; else p = aff_entry->ae_add; + /* PFX_FLAGS is a negative number, so that * tree_add_word() knows this is the prefix tree. */ n = PFX_FLAGS; - if (rare) - n |= WFP_RARE; if (!cur_aff->ah_combine) n |= WFP_NC; if (upper) @@ -5709,7 +5830,7 @@ spell_read_aff(spin, fname) /* Use compound specifications of the .aff file for the spell info. */ if (compmax != 0) { - aff_check_number(spin->si_compmax, compmax, "COMPOUNDMAX"); + aff_check_number(spin->si_compmax, compmax, "COMPOUNDWORDMAX"); spin->si_compmax = compmax; } @@ -5727,6 +5848,12 @@ spell_read_aff(spin, fname) spin->si_compsylmax = compsylmax; } + if (compoptions != 0) + { + aff_check_number(spin->si_compoptions, compoptions, "COMPOUND options"); + spin->si_compoptions |= compoptions; + } + if (compflags != NULL) process_compflags(spin, aff, compflags); @@ -6327,6 +6454,9 @@ spell_read_dic(spin, fname, affile) if (affile->af_needcomp != 0 && flag_in_afflist( affile->af_flagtype, afflist, affile->af_needcomp)) flags |= WF_NEEDCOMP; + if (affile->af_comproot != 0 && flag_in_afflist( + affile->af_flagtype, afflist, affile->af_comproot)) + flags |= WF_COMPROOT; if (affile->af_nosuggest != 0 && flag_in_afflist( affile->af_flagtype, afflist, affile->af_nosuggest)) flags |= WF_NOSUGGEST; @@ -6512,11 +6642,12 @@ store_aff_word(spin, word, afflist, affile, ht, xht, comb, flags, * Another requirement from Myspell is that the chop * string is shorter than the word itself. * For prefixes, when "PFXPOSTPONE" was used, only do - * prefixes with a chop string. */ + * prefixes with a chop string and/or flags. */ regmatch.regprog = ae->ae_prog; regmatch.rm_ic = FALSE; if ((xht != NULL || !affile->af_pfxpostpone - || ae->ae_chop != NULL) + || ae->ae_chop != NULL + || ae->ae_flags != NULL) && (ae->ae_chop == NULL || STRLEN(ae->ae_chop) < wordlen) && (ae->ae_prog == NULL @@ -6565,15 +6696,24 @@ store_aff_word(spin, word, afflist, affile, ht, xht, comb, flags, } /* Obey the "rare" flag of the affix. */ - if (ae->ae_rare) + if (affile->af_rare != 0 + && ae->ae_flags != NULL + && flag_in_afflist( + affile->af_flagtype, ae->ae_flags, + affile->af_rare)) use_flags = flags | WF_RARE; else use_flags = flags; - /* Obey the "nocomp" flag of the affix: don't use the - * compound flags. */ + /* Obey a "COMPOUNDFORBID" flag of the affix: don't + * use the compound flags. */ use_pfxlist = pfxlist; - if (ae->ae_nocomp && pfxlist != NULL) + if (pfxlist != NULL + && affile->af_compforbid != 0 + && ae->ae_flags != NULL + && flag_in_afflist( + affile->af_flagtype, ae->ae_flags, + affile->af_compforbid)) { vim_strncpy(pfx_pfxlist, pfxlist, pfxlen); use_pfxlist = pfx_pfxlist; @@ -7803,12 +7943,26 @@ write_vim_spell(spin, fname) putc(0, fd); /* <sectionflags> */ l = STRLEN(spin->si_compflags); - put_bytes(fd, (long_u)(l + 3), 4); /* <sectionlen> */ + for (i = 0; i < spin->si_comppat.ga_len; ++i) + l += STRLEN(((char_u **)(spin->si_comppat.ga_data))[i]) + 1; + put_bytes(fd, (long_u)(l + 7), 4); /* <sectionlen> */ + putc(spin->si_compmax, fd); /* <compmax> */ putc(spin->si_compminlen, fd); /* <compminlen> */ putc(spin->si_compsylmax, fd); /* <compsylmax> */ + putc(0, fd); /* for Vim 7.0b compatibility */ + putc(spin->si_compoptions, fd); /* <compoptions> */ + put_bytes(fd, (long_u)spin->si_comppat.ga_len, 2); + /* <comppatcount> */ + for (i = 0; i < spin->si_comppat.ga_len; ++i) + { + p = ((char_u **)(spin->si_comppat.ga_data))[i]; + putc(STRLEN(p), fd); /* <comppatlen> */ + fwrite(p, (size_t)STRLEN(p), (size_t)1, fd);/* <comppattext> */ + } /* <compflags> */ - fwrite(spin->si_compflags, (size_t)l, (size_t)1, fd); + fwrite(spin->si_compflags, (size_t)STRLEN(spin->si_compflags), + (size_t)1, fd); } /* SN_NOBREAK: NOBREAK flag */ @@ -8611,6 +8765,7 @@ mkspell(fcount, fnames, ascii, overwrite, added_word) ga_init2(&spin.si_repsal, (int)sizeof(fromto_T), 20); ga_init2(&spin.si_sal, (int)sizeof(fromto_T), 20); ga_init2(&spin.si_map, (int)sizeof(char_u), 100); + ga_init2(&spin.si_comppat, (int)sizeof(char_u *), 20); ga_init2(&spin.si_prefcond, (int)sizeof(char_u *), 50); hash_init(&spin.si_commonwords); spin.si_newcompID = 127; /* start compound ID at first maximum */ @@ -8804,6 +8959,7 @@ mkspell(fcount, fnames, ascii, overwrite, added_word) ga_clear(&spin.si_repsal); ga_clear(&spin.si_sal); ga_clear(&spin.si_map); + ga_clear(&spin.si_comppat); ga_clear(&spin.si_prefcond); hash_clear_all(&spin.si_commonwords, 0); diff --git a/src/syntax.c b/src/syntax.c index 7776c0905..f66f63957 100644 --- a/src/syntax.c +++ b/src/syntax.c @@ -6066,203 +6066,208 @@ syn_get_foldlevel(wp, lnum) * The #ifdefs are needed to reduce the amount of static data. Helps to make * the 16 bit DOS (museum) version compile. */ +#ifdef FEAT_GUI +# define CENT(a, b) b +#else +# define CENT(a, b) a +#endif static char *(highlight_init_both[]) = { - "ErrorMsg term=standout ctermbg=DarkRed ctermfg=White", - "IncSearch term=reverse cterm=reverse", - "ModeMsg term=bold cterm=bold", - "NonText term=bold ctermfg=Blue", - "StatusLine term=reverse,bold cterm=reverse,bold", - "StatusLineNC term=reverse cterm=reverse", + CENT("ErrorMsg term=standout ctermbg=DarkRed ctermfg=White", + "ErrorMsg term=standout ctermbg=DarkRed ctermfg=White guibg=Red guifg=White"), + CENT("IncSearch term=reverse cterm=reverse", + "IncSearch term=reverse cterm=reverse gui=reverse"), + CENT("ModeMsg term=bold cterm=bold", + "ModeMsg term=bold cterm=bold gui=bold"), + CENT("NonText term=bold ctermfg=Blue", + "NonText term=bold ctermfg=Blue gui=bold guifg=Blue"), + CENT("StatusLine term=reverse,bold cterm=reverse,bold", + "StatusLine term=reverse,bold cterm=reverse,bold gui=reverse,bold"), + CENT("StatusLineNC term=reverse cterm=reverse", + "StatusLineNC term=reverse cterm=reverse gui=reverse"), #ifdef FEAT_VERTSPLIT - "VertSplit term=reverse cterm=reverse", + CENT("VertSplit term=reverse cterm=reverse", + "VertSplit term=reverse cterm=reverse gui=reverse"), #endif #ifdef FEAT_CLIPBOARD - "VisualNOS term=underline,bold cterm=underline,bold", + CENT("VisualNOS term=underline,bold cterm=underline,bold", + "VisualNOS term=underline,bold cterm=underline,bold gui=underline,bold"), #endif #ifdef FEAT_DIFF - "DiffText term=reverse cterm=bold ctermbg=Red", + CENT("DiffText term=reverse cterm=bold ctermbg=Red", + "DiffText term=reverse cterm=bold ctermbg=Red gui=bold guibg=Red"), #endif #ifdef FEAT_INS_EXPAND - "PmenuThumb cterm=reverse", - "PmenuSbar ctermbg=Grey", + CENT("PmenuThumb cterm=reverse", + "PmenuThumb cterm=reverse gui=reverse"), + CENT("PmenuSbar ctermbg=Grey", + "PmenuSbar ctermbg=Grey guibg=Grey"), #endif #ifdef FEAT_WINDOWS - "TabLineSel term=bold cterm=bold", - "TabLineFill term=reverse cterm=reverse", + CENT("TabLineSel term=bold cterm=bold", + "TabLineSel term=bold cterm=bold gui=bold"), + CENT("TabLineFill term=reverse cterm=reverse", + "TabLineFill term=reverse cterm=reverse gui=reverse"), #endif #ifdef FEAT_AUTOCMD - "MatchParen term=reverse ctermbg=Cyan", + CENT("MatchParen term=reverse ctermbg=Cyan", + "MatchParen term=reverse ctermbg=Cyan guibg=Cyan"), #endif #ifdef FEAT_GUI - "ErrorMsg guibg=Red guifg=White", - "IncSearch gui=reverse", - "ModeMsg gui=bold", - "NonText gui=bold guifg=Blue", - "StatusLine gui=reverse,bold", - "StatusLineNC gui=reverse", - "VertSplit gui=reverse", - "VisualNOS gui=underline,bold", - "DiffText gui=bold guibg=Red", - "PmenuThumb gui=reverse", - "PmenuSbar guibg=Grey", - "TabLineSel gui=bold", - "TabLineFill gui=reverse", - "MatchParen guibg=Cyan", "Cursor guibg=fg guifg=bg", - "lCursor guibg=fg guifg=bg", /* should be different, but what? */ + "lCursor guibg=fg guifg=bg", /* should be different, but what? */ #endif NULL }; static char *(highlight_init_light[]) = { - "Directory term=bold ctermfg=DarkBlue", - "LineNr term=underline ctermfg=Brown", - "MoreMsg term=bold ctermfg=DarkGreen", - "Question term=standout ctermfg=DarkGreen", - "Search term=reverse ctermbg=Yellow ctermfg=NONE", + CENT("Directory term=bold ctermfg=DarkBlue", + "Directory term=bold ctermfg=DarkBlue guifg=Blue"), + CENT("LineNr term=underline ctermfg=Brown", + "LineNr term=underline ctermfg=Brown guifg=Brown"), + CENT("MoreMsg term=bold ctermfg=DarkGreen", + "MoreMsg term=bold ctermfg=DarkGreen gui=bold guifg=SeaGreen"), + CENT("Question term=standout ctermfg=DarkGreen", + "Question term=standout ctermfg=DarkGreen gui=bold guifg=SeaGreen"), + CENT("Search term=reverse ctermbg=Yellow ctermfg=NONE", + "Search term=reverse ctermbg=Yellow ctermfg=NONE guibg=Yellow guifg=NONE"), #ifdef FEAT_SPELL - "SpellBad term=reverse ctermbg=LightRed", - "SpellCap term=reverse ctermbg=LightBlue", - "SpellRare term=reverse ctermbg=LightMagenta", - "SpellLocal term=underline ctermbg=Cyan", + CENT("SpellBad term=reverse ctermbg=LightRed", + "SpellBad term=reverse ctermbg=LightRed guisp=Red gui=undercurl"), + CENT("SpellCap term=reverse ctermbg=LightBlue", + "SpellCap term=reverse ctermbg=LightBlue guisp=Blue gui=undercurl"), + CENT("SpellRare term=reverse ctermbg=LightMagenta", + "SpellRare term=reverse ctermbg=LightMagenta guisp=Magenta gui=undercurl"), + CENT("SpellLocal term=underline ctermbg=Cyan", + "SpellLocal term=underline ctermbg=Cyan guisp=DarkCyan gui=undercurl"), #endif #ifdef FEAT_INS_EXPAND - "Pmenu ctermbg=LightMagenta", - "PmenuSel ctermbg=LightGrey", + CENT("Pmenu ctermbg=LightMagenta", + "Pmenu ctermbg=LightMagenta guibg=LightMagenta"), + CENT("PmenuSel ctermbg=LightGrey", + "PmenuSel ctermbg=LightGrey guibg=Grey"), #endif - "SpecialKey term=bold ctermfg=DarkBlue", - "Title term=bold ctermfg=DarkMagenta", - "WarningMsg term=standout ctermfg=DarkRed", + CENT("SpecialKey term=bold ctermfg=DarkBlue", + "SpecialKey term=bold ctermfg=DarkBlue guifg=Blue"), + CENT("Title term=bold ctermfg=DarkMagenta", + "Title term=bold ctermfg=DarkMagenta gui=bold guifg=Magenta"), + CENT("WarningMsg term=standout ctermfg=DarkRed", + "WarningMsg term=standout ctermfg=DarkRed guifg=Red"), #ifdef FEAT_WILDMENU - "WildMenu term=standout ctermbg=Yellow ctermfg=Black", + CENT("WildMenu term=standout ctermbg=Yellow ctermfg=Black", + "WildMenu term=standout ctermbg=Yellow ctermfg=Black guibg=Yellow guifg=Black"), #endif #ifdef FEAT_FOLDING - "Folded term=standout ctermbg=Grey ctermfg=DarkBlue", - "FoldColumn term=standout ctermbg=Grey ctermfg=DarkBlue", + CENT("Folded term=standout ctermbg=Grey ctermfg=DarkBlue", + "Folded term=standout ctermbg=Grey ctermfg=DarkBlue guibg=LightGrey guifg=DarkBlue"), + CENT("FoldColumn term=standout ctermbg=Grey ctermfg=DarkBlue", + "FoldColumn term=standout ctermbg=Grey ctermfg=DarkBlue guibg=Grey guifg=DarkBlue"), #endif #ifdef FEAT_SIGNS - "SignColumn term=standout ctermbg=Grey ctermfg=DarkBlue", + CENT("SignColumn term=standout ctermbg=Grey ctermfg=DarkBlue", + "SignColumn term=standout ctermbg=Grey ctermfg=DarkBlue guibg=Grey guifg=DarkBlue"), #endif #ifdef FEAT_VISUAL - "Visual term=reverse ctermbg=Magenta", + CENT("Visual term=reverse ctermbg=Magenta", + "Visual term=reverse ctermbg=Magenta guibg=LightGrey"), #endif #ifdef FEAT_DIFF - "DiffAdd term=bold ctermbg=LightBlue", - "DiffChange term=bold ctermbg=LightMagenta", - "DiffDelete term=bold ctermfg=Blue ctermbg=LightCyan", + CENT("DiffAdd term=bold ctermbg=LightBlue", + "DiffAdd term=bold ctermbg=LightBlue guibg=LightBlue"), + CENT("DiffChange term=bold ctermbg=LightMagenta", + "DiffChange term=bold ctermbg=LightMagenta guibg=LightMagenta"), + CENT("DiffDelete term=bold ctermfg=Blue ctermbg=LightCyan", + "DiffDelete term=bold ctermfg=Blue ctermbg=LightCyan gui=bold guifg=Blue guibg=LightCyan"), #endif #ifdef FEAT_WINDOWS - "TabLine term=underline cterm=underline ctermfg=black ctermbg=LightGrey", + CENT("TabLine term=underline cterm=underline ctermfg=black ctermbg=LightGrey", + "TabLine term=underline cterm=underline ctermfg=black ctermbg=LightGrey gui=underline guibg=LightGrey"), #endif #ifdef FEAT_SYN_HL - "CursorColumn term=reverse ctermbg=LightGrey", - "CursorLine term=underline cterm=underline", + CENT("CursorColumn term=reverse ctermbg=LightGrey", + "CursorColumn term=reverse ctermbg=LightGrey guibg=LightGrey"), + CENT("CursorLine term=underline cterm=underline", + "CursorLine term=underline cterm=underline guibg=LightGrey"), #endif #ifdef FEAT_GUI - "Directory guifg=Blue", - "LineNr guifg=Brown", - "MoreMsg gui=bold guifg=SeaGreen", "Normal gui=NONE", - "Question gui=bold guifg=SeaGreen", - "Search guibg=Yellow guifg=NONE", - "SpellBad guisp=Red gui=undercurl", - "SpellCap guisp=Blue gui=undercurl", - "SpellRare guisp=Magenta gui=undercurl", - "SpellLocal guisp=DarkCyan gui=undercurl", - "Pmenu guibg=LightMagenta", - "PmenuSel guibg=Grey", - "SpecialKey guifg=Blue", - "Title gui=bold guifg=Magenta", - "WarningMsg guifg=Red", - "WildMenu guibg=Yellow guifg=Black", - "Folded guibg=LightGrey guifg=DarkBlue", - "FoldColumn guibg=Grey guifg=DarkBlue", - "SignColumn guibg=Grey guifg=DarkBlue", - "Visual guibg=LightGrey", - "DiffAdd guibg=LightBlue", - "DiffChange guibg=LightMagenta", - "DiffDelete gui=bold guifg=Blue guibg=LightCyan", - "TabLine gui=underline guibg=LightGrey", - "CursorColumn guibg=LightGrey", - "CursorLine guibg=LightGrey", #endif NULL }; static char *(highlight_init_dark[]) = { - "Directory term=bold ctermfg=LightCyan", - "LineNr term=underline ctermfg=Yellow", - "MoreMsg term=bold ctermfg=LightGreen", - "Question term=standout ctermfg=LightGreen", - "Search term=reverse ctermbg=Yellow ctermfg=Black", - "SpecialKey term=bold ctermfg=LightBlue", + CENT("Directory term=bold ctermfg=LightCyan", + "Directory term=bold ctermfg=LightCyan guifg=Cyan"), + CENT("LineNr term=underline ctermfg=Yellow", + "LineNr term=underline ctermfg=Yellow guifg=Yellow"), + CENT("MoreMsg term=bold ctermfg=LightGreen", + "MoreMsg term=bold ctermfg=LightGreen gui=bold guifg=SeaGreen"), + CENT("Question term=standout ctermfg=LightGreen", + "Question term=standout ctermfg=LightGreen gui=bold guifg=Green"), + CENT("Search term=reverse ctermbg=Yellow ctermfg=Black", + "Search term=reverse ctermbg=Yellow ctermfg=Black guibg=Yellow guifg=Black"), + CENT("SpecialKey term=bold ctermfg=LightBlue", + "SpecialKey term=bold ctermfg=LightBlue guifg=Cyan"), #ifdef FEAT_SPELL - "SpellBad term=reverse ctermbg=Red", - "SpellCap term=reverse ctermbg=Blue", - "SpellRare term=reverse ctermbg=Magenta", - "SpellLocal term=underline ctermbg=Cyan", + CENT("SpellBad term=reverse ctermbg=Red", + "SpellBad term=reverse ctermbg=Red guisp=Red gui=undercurl"), + CENT("SpellCap term=reverse ctermbg=Blue", + "SpellCap term=reverse ctermbg=Blue guisp=Blue gui=undercurl"), + CENT("SpellRare term=reverse ctermbg=Magenta", + "SpellRare term=reverse ctermbg=Magenta guisp=Magenta gui=undercurl"), + CENT("SpellLocal term=underline ctermbg=Cyan", + "SpellLocal term=underline ctermbg=Cyan guisp=Cyan gui=undercurl"), #endif #ifdef FEAT_INS_EXPAND - "Pmenu ctermbg=Magenta", - "PmenuSel ctermbg=DarkGrey", + CENT("Pmenu ctermbg=Magenta", + "Pmenu ctermbg=Magenta guibg=Magenta"), + CENT("PmenuSel ctermbg=DarkGrey", + "PmenuSel ctermbg=DarkGrey guibg=DarkGrey"), #endif - "Title term=bold ctermfg=LightMagenta", - "WarningMsg term=standout ctermfg=LightRed", + CENT("Title term=bold ctermfg=LightMagenta", + "Title term=bold ctermfg=LightMagenta gui=bold guifg=Magenta"), + CENT("WarningMsg term=standout ctermfg=LightRed", + "WarningMsg term=standout ctermfg=LightRed guifg=Red"), #ifdef FEAT_WILDMENU - "WildMenu term=standout ctermbg=Yellow ctermfg=Black", + CENT("WildMenu term=standout ctermbg=Yellow ctermfg=Black", + "WildMenu term=standout ctermbg=Yellow ctermfg=Black guibg=Yellow guifg=Black"), #endif #ifdef FEAT_FOLDING - "Folded term=standout ctermbg=DarkGrey ctermfg=Cyan", - "FoldColumn term=standout ctermbg=DarkGrey ctermfg=Cyan", + CENT("Folded term=standout ctermbg=DarkGrey ctermfg=Cyan", + "Folded term=standout ctermbg=DarkGrey ctermfg=Cyan guibg=DarkGrey guifg=Cyan"), + CENT("FoldColumn term=standout ctermbg=DarkGrey ctermfg=Cyan", + "FoldColumn term=standout ctermbg=DarkGrey ctermfg=Cyan guibg=Grey guifg=Cyan"), #endif #ifdef FEAT_SIGNS - "SignColumn term=standout ctermbg=DarkGrey ctermfg=Cyan", + CENT("SignColumn term=standout ctermbg=DarkGrey ctermfg=Cyan", + "SignColumn term=standout ctermbg=DarkGrey ctermfg=Cyan guibg=Grey guifg=Cyan"), #endif #ifdef FEAT_VISUAL - "Visual term=reverse ctermbg=Magenta", + CENT("Visual term=reverse ctermbg=Magenta", + "Visual term=reverse ctermbg=Magenta guibg=DarkGrey"), #endif #ifdef FEAT_DIFF - "DiffAdd term=bold ctermbg=DarkBlue", - "DiffChange term=bold ctermbg=DarkMagenta", - "DiffDelete term=bold ctermfg=Blue ctermbg=DarkCyan", + CENT("DiffAdd term=bold ctermbg=DarkBlue", + "DiffAdd term=bold ctermbg=DarkBlue guibg=DarkBlue"), + CENT("DiffChange term=bold ctermbg=DarkMagenta", + "DiffChange term=bold ctermbg=DarkMagenta guibg=DarkMagenta"), + CENT("DiffDelete term=bold ctermfg=Blue ctermbg=DarkCyan", + "DiffDelete term=bold ctermfg=Blue ctermbg=DarkCyan gui=bold guifg=Blue guibg=DarkCyan"), #endif #ifdef FEAT_WINDOWS - "TabLine term=underline cterm=underline ctermfg=white ctermbg=DarkGrey", + CENT("TabLine term=underline cterm=underline ctermfg=white ctermbg=DarkGrey", + "TabLine term=underline cterm=underline ctermfg=white ctermbg=DarkGrey gui=underline guibg=DarkGrey"), #endif #ifdef FEAT_SYN_HL - "CursorColumn term=reverse ctermbg=DarkGrey", - "CursorLine term=underline cterm=underline", + CENT("CursorColumn term=reverse ctermbg=DarkGrey", + "CursorColumn term=reverse ctermbg=DarkGrey guibg=DarkGrey"), + CENT("CursorLine term=underline cterm=underline", + "CursorLine term=underline cterm=underline guibg=DarkGrey"), #endif #ifdef FEAT_GUI - "Directory guifg=Cyan", - "LineNr guifg=Yellow", - "MoreMsg gui=bold guifg=SeaGreen", "Normal gui=NONE", - "Question gui=bold guifg=Green", - "Search guibg=Yellow guifg=Black", - "SpecialKey guifg=Cyan", - "SpellBad guisp=Red gui=undercurl", - "SpellCap guisp=Blue gui=undercurl", - "SpellRare guisp=Magenta gui=undercurl", - "SpellLocal guisp=Cyan gui=undercurl", - "Pmenu guibg=Magenta", - "PmenuSel guibg=DarkGrey", - "Title gui=bold guifg=Magenta", - "WarningMsg guifg=Red", - "WildMenu guibg=Yellow guifg=Black", - "Folded guibg=DarkGrey guifg=Cyan", - "FoldColumn guibg=Grey guifg=Cyan", - "SignColumn guibg=Grey guifg=Cyan", - "Visual guibg=DarkGrey", - "DiffAdd guibg=DarkBlue", - "DiffChange guibg=DarkMagenta", - "DiffDelete gui=bold guifg=Blue guibg=DarkCyan", - "TabLine gui=underline guibg=DarkGrey", - "CursorColumn guibg=DarkGrey", - "CursorLine guibg=DarkGrey", #endif NULL }; diff --git a/src/testdir/test58.in b/src/testdir/test58.in index 7db6a9ed2..0cd84ee36 100644 --- a/src/testdir/test58.in +++ b/src/testdir/test58.in @@ -420,7 +420,8 @@ COMPOUNDRULE m+ COMPOUNDRULE sm*e COMPOUNDRULE sm+ COMPOUNDMIN 3 -COMPOUNDMAX 3 +COMPOUNDWORDMAX 3 +COMPOUNDFORBIDFLAG t COMPOUNDSYLMAX 5 SYLLABLE aáeéiíoóöõuúüûy/aa/au/ea/ee/ei/ie/oa/oe/oo/ou/uu/ui @@ -447,7 +448,7 @@ SFX q 0 -ok . SFX a Y 2 SFX a 0 s . -SFX a 0 ize . nocomp +SFX a 0 ize/t . PFX p N 1 PFX p 0 pre . diff --git a/src/testdir/test59.in b/src/testdir/test59.in index d8e0a975e..cf9cb4938 100644 --- a/src/testdir/test59.in +++ b/src/testdir/test59.in @@ -424,7 +424,8 @@ COMPOUNDRULE m+ COMPOUNDRULE sm*e COMPOUNDRULE sm+ COMPOUNDMIN 3 -COMPOUNDMAX 3 +COMPOUNDWORDMAX 3 +COMPOUNDFORBIDFLAG t COMPOUNDSYLMAX 5 SYLLABLE aáeéiíoóöõuúüûy/aa/au/ea/ee/ei/ie/oa/oe/oo/ou/uu/ui @@ -451,7 +452,7 @@ SFX q 0 -ok . SFX a Y 2 SFX a 0 s . -SFX a 0 ize . nocomp +SFX a 0 ize/t . PFX p N 1 PFX p 0 pre . diff --git a/src/version.h b/src/version.h index d8cde672c..965ee8362 100644 --- a/src/version.h +++ b/src/version.h @@ -36,5 +36,5 @@ #define VIM_VERSION_NODOT "vim70b" #define VIM_VERSION_SHORT "7.0b" #define VIM_VERSION_MEDIUM "7.0b BETA" -#define VIM_VERSION_LONG "VIM - Vi IMproved 7.0b BETA (2006 Mar 25)" -#define VIM_VERSION_LONG_DATE "VIM - Vi IMproved 7.0b BETA (2006 Mar 25, compiled " +#define VIM_VERSION_LONG "VIM - Vi IMproved 7.0b BETA (2006 Mar 26)" +#define VIM_VERSION_LONG_DATE "VIM - Vi IMproved 7.0b BETA (2006 Mar 26, compiled " diff --git a/src/xxd/xxd.c b/src/xxd/xxd.c index 2b3ee9c03..f57d78634 100644 --- a/src/xxd/xxd.c +++ b/src/xxd/xxd.c @@ -275,6 +275,9 @@ long base_off; if (c == '\r') /* Doze style input file? */ continue; + if (c == ' ' || c == '\n' || c == '\t') /* allow multiple spaces */ + continue; + n3 = n2; n2 = n1; @@ -334,7 +337,7 @@ long base_off; n1 = -1; if ((++p >= cols) && !hextype) { - /* skip rest of line as garbaga */ + /* skip rest of line as garbage */ want_off = 0; while ((c = getc(fpi)) != '\n' && c != EOF) ; |