0
0
mirror of https://github.com/vim/vim.git synced 2025-09-23 03:43:49 -04:00

updated for version 7.0222

This commit is contained in:
Bram Moolenaar
2006-03-12 22:08:12 +00:00
parent 600dddcf66
commit b9a02fc557
6 changed files with 110 additions and 47 deletions

View File

@@ -169,7 +169,7 @@ static void internal_format __ARGS((int textwidth, int second_indent, int flags,
static void check_auto_format __ARGS((int)); static void check_auto_format __ARGS((int));
static void redo_literal __ARGS((int c)); static void redo_literal __ARGS((int c));
static void start_arrow __ARGS((pos_T *end_insert_pos)); static void start_arrow __ARGS((pos_T *end_insert_pos));
#ifdef FEAT_SYN_HL #ifdef FEAT_SPELL
static void check_spell_redraw __ARGS((void)); static void check_spell_redraw __ARGS((void));
static void spell_back_to_badword __ARGS((void)); static void spell_back_to_badword __ARGS((void));
static int spell_bad_len = 0; /* length of located bad word */ static int spell_bad_len = 0; /* length of located bad word */
@@ -1911,7 +1911,10 @@ has_compl_option(dict_opt)
int dict_opt; int dict_opt;
{ {
if (dict_opt ? (*curbuf->b_p_dict == NUL && *p_dict == NUL if (dict_opt ? (*curbuf->b_p_dict == NUL && *p_dict == NUL
&& !curwin->w_p_spell) # ifdef FEAT_SPELL
&& !curwin->w_p_spell
# endif
)
: (*curbuf->b_p_tsr == NUL && *p_tsr == NUL)) : (*curbuf->b_p_tsr == NUL && *p_tsr == NUL))
{ {
ctrl_x_mode = 0; ctrl_x_mode = 0;
@@ -2333,7 +2336,7 @@ set_completion(startcol, list)
if (stop_arrow() == FAIL) if (stop_arrow() == FAIL)
return; return;
if (startcol > curwin->w_cursor.col) if (startcol > (int)curwin->w_cursor.col)
startcol = curwin->w_cursor.col; startcol = curwin->w_cursor.col;
compl_col = startcol; compl_col = startcol;
compl_length = curwin->w_cursor.col - startcol; compl_length = curwin->w_cursor.col - startcol;
@@ -2589,7 +2592,7 @@ ins_compl_dictionaries(dict_start, pat, flags, thesaurus)
if (*dict == NUL) if (*dict == NUL)
{ {
#ifdef FEAT_SYN_HL #ifdef FEAT_SPELL
/* When 'dictionary' is empty and spell checking is enabled use /* When 'dictionary' is empty and spell checking is enabled use
* "spell". */ * "spell". */
if (!thesaurus && curwin->w_p_spell) if (!thesaurus && curwin->w_p_spell)
@@ -2644,14 +2647,18 @@ ins_compl_dictionaries(dict_start, pat, flags, thesaurus)
* backticks (for security, the 'dict' option may have been set in * backticks (for security, the 'dict' option may have been set in
* a modeline). */ * a modeline). */
copy_option_part(&dict, buf, LSIZE, ","); copy_option_part(&dict, buf, LSIZE, ",");
# ifdef FEAT_SPELL
if (!thesaurus && STRCMP(buf, "spell") == 0) if (!thesaurus && STRCMP(buf, "spell") == 0)
count = -1; count = -1;
else if (vim_strchr(buf, '`') != NULL else
# endif
if (vim_strchr(buf, '`') != NULL
|| expand_wildcards(1, &buf, &count, &files, || expand_wildcards(1, &buf, &count, &files,
EW_FILE|EW_SILENT) != OK) EW_FILE|EW_SILENT) != OK)
count = 0; count = 0;
} }
# ifdef FEAT_SPELL
if (count == -1) if (count == -1)
{ {
/* Complete from active spelling. Skip "\<" in the pattern, we /* Complete from active spelling. Skip "\<" in the pattern, we
@@ -2663,6 +2670,7 @@ ins_compl_dictionaries(dict_start, pat, flags, thesaurus)
spell_dump_compl(curbuf, ptr, regmatch.rm_ic, &dir, 0); spell_dump_compl(curbuf, ptr, regmatch.rm_ic, &dir, 0);
} }
else else
# endif
{ {
ins_compl_files(count, files, thesaurus, flags, ins_compl_files(count, files, thesaurus, flags,
&regmatch, buf, &dir); &regmatch, buf, &dir);
@@ -3116,7 +3124,7 @@ ins_compl_prep(c)
case 's': case 's':
case Ctrl_S: case Ctrl_S:
ctrl_x_mode = CTRL_X_SPELL; ctrl_x_mode = CTRL_X_SPELL;
#ifdef FEAT_SYN_HL #ifdef FEAT_SPELL
spell_back_to_badword(); spell_back_to_badword();
#endif #endif
break; break;
@@ -3646,7 +3654,7 @@ ins_compl_get_exp(ini)
#endif #endif
case CTRL_X_SPELL: case CTRL_X_SPELL:
#ifdef FEAT_SYN_HL #ifdef FEAT_SPELL
num_matches = expand_spelling(first_match_pos.lnum, num_matches = expand_spelling(first_match_pos.lnum,
first_match_pos.col, compl_pattern, &matches); first_match_pos.col, compl_pattern, &matches);
if (num_matches > 0) if (num_matches > 0)
@@ -4445,7 +4453,7 @@ ins_complete(c)
} }
else if (ctrl_x_mode == CTRL_X_SPELL) else if (ctrl_x_mode == CTRL_X_SPELL)
{ {
#ifdef FEAT_SYN_HL #ifdef FEAT_SPELL
if (spell_bad_len > 0) if (spell_bad_len > 0)
compl_col = curs_col - spell_bad_len; compl_col = curs_col - spell_bad_len;
else else
@@ -5718,12 +5726,12 @@ start_arrow(end_insert_pos)
stop_insert(end_insert_pos, FALSE); stop_insert(end_insert_pos, FALSE);
arrow_used = TRUE; /* this means we stopped the current insert */ arrow_used = TRUE; /* this means we stopped the current insert */
} }
#ifdef FEAT_SYN_HL #ifdef FEAT_SPELL
check_spell_redraw(); check_spell_redraw();
#endif #endif
} }
#ifdef FEAT_SYN_HL #ifdef FEAT_SPELL
/* /*
* If we skipped highlighting word at cursor, do it now. * If we skipped highlighting word at cursor, do it now.
* It may be skipped again, thus reset spell_redraw_lnum first. * It may be skipped again, thus reset spell_redraw_lnum first.
@@ -7303,7 +7311,7 @@ ins_esc(count, cmdchar, nomove)
int temp; int temp;
static int disabled_redraw = FALSE; static int disabled_redraw = FALSE;
#ifdef FEAT_SYN_HL #ifdef FEAT_SPELL
check_spell_redraw(); check_spell_redraw();
#endif #endif
#if defined(FEAT_HANGULIN) #if defined(FEAT_HANGULIN)

View File

@@ -1271,7 +1271,9 @@ EXTERN int virtual_op INIT(= MAYBE);
#ifdef FEAT_SYN_HL #ifdef FEAT_SYN_HL
/* Display tick, incremented for each call to update_screen() */ /* Display tick, incremented for each call to update_screen() */
EXTERN disptick_T display_tick INIT(= 0); EXTERN disptick_T display_tick INIT(= 0);
#endif
#ifdef FEAT_SPELL
/* Line in which spell checking wasn't highlighted because it touched the /* Line in which spell checking wasn't highlighted because it touched the
* cursor position in Insert mode. */ * cursor position in Insert mode. */
EXTERN linenr_T spell_redraw_lnum INIT(= 0); EXTERN linenr_T spell_redraw_lnum INIT(= 0);

View File

@@ -148,7 +148,9 @@ static void prt_line_number __ARGS((prt_settings_T *psettings, int page_line, li
static void prt_header __ARGS((prt_settings_T *psettings, int pagenum, linenr_T lnum)); static void prt_header __ARGS((prt_settings_T *psettings, int pagenum, linenr_T lnum));
static void prt_message __ARGS((char_u *s)); static void prt_message __ARGS((char_u *s));
static colnr_T hardcopy_line __ARGS((prt_settings_T *psettings, int page_line, prt_pos_T *ppos)); static colnr_T hardcopy_line __ARGS((prt_settings_T *psettings, int page_line, prt_pos_T *ppos));
#ifdef FEAT_SYN_HL
static void prt_get_attr __ARGS((int hl_id, prt_text_attr_T* pattr, int modec)); static void prt_get_attr __ARGS((int hl_id, prt_text_attr_T* pattr, int modec));
#endif
/* /*
* Parse 'printoptions' and set the flags in "printer_opts". * Parse 'printoptions' and set the flags in "printer_opts".
@@ -566,7 +568,6 @@ ex_hardcopy(eap)
long_u bytes_to_print = 0; long_u bytes_to_print = 0;
int page_line; int page_line;
int jobsplit; int jobsplit;
int id;
memset(&settings, 0, sizeof(prt_settings_T)); memset(&settings, 0, sizeof(prt_settings_T));
settings.has_color = TRUE; settings.has_color = TRUE;
@@ -638,13 +639,15 @@ ex_hardcopy(eap)
*/ */
if (prt_use_number() && settings.do_syntax) if (prt_use_number() && settings.do_syntax)
{ {
int id;
id = syn_name2id((char_u *)"LineNr"); id = syn_name2id((char_u *)"LineNr");
if (id > 0) if (id > 0)
id = syn_get_final_id(id); id = syn_get_final_id(id);
prt_get_attr(id, &settings.number, settings.modec); prt_get_attr(id, &settings.number, settings.modec);
} }
#endif /* FEAT_SYN_HL */ #endif
/* /*
* Estimate the total lines to be printed * Estimate the total lines to be printed
@@ -890,7 +893,7 @@ hardcopy_line(psettings, page_line, ppos)
prt_set_bg(attr.bg_color); prt_set_bg(attr.bg_color);
} }
} }
#endif /* FEAT_SYN_HL */ #endif
/* /*
* Appropriately expand any tabs to spaces. * Appropriately expand any tabs to spaces.

View File

@@ -156,10 +156,12 @@
#endif #endif
#ifdef FEAT_SYN_HL #ifdef FEAT_SYN_HL
# define PV_SMC OPT_BUF(BV_SMC) # define PV_SMC OPT_BUF(BV_SMC)
# define PV_SYN OPT_BUF(BV_SYN)
#endif
#ifdef FEAT_SPELL
# define PV_SPC OPT_BUF(BV_SPC) # define PV_SPC OPT_BUF(BV_SPC)
# define PV_SPF OPT_BUF(BV_SPF) # define PV_SPF OPT_BUF(BV_SPF)
# define PV_SPL OPT_BUF(BV_SPL) # define PV_SPL OPT_BUF(BV_SPL)
# define PV_SYN OPT_BUF(BV_SYN)
#endif #endif
#define PV_STS OPT_BUF(BV_STS) #define PV_STS OPT_BUF(BV_STS)
#ifdef FEAT_SEARCHPATH #ifdef FEAT_SEARCHPATH
@@ -216,9 +218,13 @@
# define PV_SCBIND OPT_WIN(WV_SCBIND) # define PV_SCBIND OPT_WIN(WV_SCBIND)
#endif #endif
#define PV_SCROLL OPT_WIN(WV_SCROLL) #define PV_SCROLL OPT_WIN(WV_SCROLL)
#ifdef FEAT_SYN_HL #ifdef FEAT_SPELL
# define PV_SPELL OPT_WIN(WV_SPELL) # define PV_SPELL OPT_WIN(WV_SPELL)
#endif #endif
#ifdef FEAT_SYN_HL
# define PV_CUC OPT_WIN(WV_CUC)
# define PV_CUL OPT_WIN(WV_CUL)
#endif
#ifdef FEAT_STL_OPT #ifdef FEAT_STL_OPT
# define PV_STL OPT_BOTH(OPT_WIN(WV_STL)) # define PV_STL OPT_BOTH(OPT_WIN(WV_STL))
#endif #endif
@@ -335,6 +341,8 @@ static int p_swf;
#ifdef FEAT_SYN_HL #ifdef FEAT_SYN_HL
static long p_smc; static long p_smc;
static char_u *p_syn; static char_u *p_syn;
#endif
#ifdef FEAT_SPELL
static char_u *p_spc; static char_u *p_spc;
static char_u *p_spf; static char_u *p_spf;
static char_u *p_spl; static char_u *p_spl;
@@ -840,6 +848,20 @@ static struct vimoption
(char_u *)NULL, PV_NONE, (char_u *)NULL, PV_NONE,
#endif #endif
{(char_u *)0L, (char_u *)0L}}, {(char_u *)0L, (char_u *)0L}},
{"cursorcolumn", "cuc", P_BOOL|P_VI_DEF|P_RWIN,
#ifdef FEAT_SYN_HL
(char_u *)VAR_WIN, PV_CUC,
#else
(char_u *)NULL, PV_NONE,
#endif
{(char_u *)FALSE, (char_u *)0L}},
{"cursorline", "cul", P_BOOL|P_VI_DEF|P_RWIN,
#ifdef FEAT_SYN_HL
(char_u *)VAR_WIN, PV_CUL,
#else
(char_u *)NULL, PV_NONE,
#endif
{(char_u *)FALSE, (char_u *)0L}},
{"debug", NULL, P_STRING|P_VI_DEF, {"debug", NULL, P_STRING|P_VI_DEF,
(char_u *)&p_debug, PV_NONE, (char_u *)&p_debug, PV_NONE,
{(char_u *)"", (char_u *)0L}}, {(char_u *)"", (char_u *)0L}},
@@ -1251,7 +1273,7 @@ static struct vimoption
{(char_u *)FALSE, (char_u *)0L}}, {(char_u *)FALSE, (char_u *)0L}},
{"highlight", "hl", P_STRING|P_VI_DEF|P_RCLR|P_COMMA|P_NODUP, {"highlight", "hl", P_STRING|P_VI_DEF|P_RCLR|P_COMMA|P_NODUP,
(char_u *)&p_hl, PV_NONE, (char_u *)&p_hl, PV_NONE,
{(char_u *)"8:SpecialKey,@:NonText,d:Directory,e:ErrorMsg,i:IncSearch,l:Search,m:MoreMsg,M:ModeMsg,n:LineNr,r:Question,s:StatusLine,S:StatusLineNC,c:VertSplit,t:Title,v:Visual,V:VisualNOS,w:WarningMsg,W:WildMenu,f:Folded,F:FoldColumn,A:DiffAdd,C:DiffChange,D:DiffDelete,T:DiffText,>:SignColumn,B:SpellBad,P:SpellCap,R:SpellRare,L:SpellLocal,+:Pmenu,=:PmenuSel,x:PmenuSbar,X:PmenuThumb,*:TabLine,#:TabLineSel,_:TabLineFill", {(char_u *)"8:SpecialKey,@:NonText,d:Directory,e:ErrorMsg,i:IncSearch,l:Search,m:MoreMsg,M:ModeMsg,n:LineNr,r:Question,s:StatusLine,S:StatusLineNC,c:VertSplit,t:Title,v:Visual,V:VisualNOS,w:WarningMsg,W:WildMenu,f:Folded,F:FoldColumn,A:DiffAdd,C:DiffChange,D:DiffDelete,T:DiffText,>:SignColumn,B:SpellBad,P:SpellCap,R:SpellRare,L:SpellLocal,+:Pmenu,=:PmenuSel,x:PmenuSbar,X:PmenuThumb,*:TabLine,#:TabLineSel,_:TabLineFill,!:CursorColumn,.:CursorLine",
(char_u *)0L}}, (char_u *)0L}},
{"history", "hi", P_NUM|P_VIM, {"history", "hi", P_NUM|P_VIM,
(char_u *)&p_hi, PV_NONE, (char_u *)&p_hi, PV_NONE,
@@ -1648,7 +1670,7 @@ static struct vimoption
(char_u *)NULL, PV_NONE, (char_u *)NULL, PV_NONE,
{(char_u *)FALSE, (char_u *)0L}}, {(char_u *)FALSE, (char_u *)0L}},
{"mkspellmem", "msm", P_STRING|P_VI_DEF|P_EXPAND|P_SECURE, {"mkspellmem", "msm", P_STRING|P_VI_DEF|P_EXPAND|P_SECURE,
#ifdef FEAT_SYN_HL #ifdef FEAT_SPELL
(char_u *)&p_msm, PV_NONE, (char_u *)&p_msm, PV_NONE,
{(char_u *)"460000,2000,500", (char_u *)0L} {(char_u *)"460000,2000,500", (char_u *)0L}
#else #else
@@ -2198,14 +2220,14 @@ static struct vimoption
(char_u *)NULL, PV_NONE, (char_u *)NULL, PV_NONE,
{(char_u *)FALSE, (char_u *)0L}}, {(char_u *)FALSE, (char_u *)0L}},
{"spell", NULL, P_BOOL|P_VI_DEF|P_RWIN, {"spell", NULL, P_BOOL|P_VI_DEF|P_RWIN,
#ifdef FEAT_SYN_HL #ifdef FEAT_SPELL
(char_u *)VAR_WIN, PV_SPELL, (char_u *)VAR_WIN, PV_SPELL,
#else #else
(char_u *)NULL, PV_NONE, (char_u *)NULL, PV_NONE,
#endif #endif
{(char_u *)FALSE, (char_u *)0L}}, {(char_u *)FALSE, (char_u *)0L}},
{"spellcapcheck", "spc", P_STRING|P_ALLOCED|P_VI_DEF|P_RBUF, {"spellcapcheck", "spc", P_STRING|P_ALLOCED|P_VI_DEF|P_RBUF,
#ifdef FEAT_SYN_HL #ifdef FEAT_SPELL
(char_u *)&p_spc, PV_SPC, (char_u *)&p_spc, PV_SPC,
{(char_u *)"[.?!]\\_[\\])'\" ]\\+", (char_u *)0L} {(char_u *)"[.?!]\\_[\\])'\" ]\\+", (char_u *)0L}
#else #else
@@ -2214,7 +2236,7 @@ static struct vimoption
#endif #endif
}, },
{"spellfile", "spf", P_STRING|P_EXPAND|P_ALLOCED|P_VI_DEF|P_SECURE|P_COMMA, {"spellfile", "spf", P_STRING|P_EXPAND|P_ALLOCED|P_VI_DEF|P_SECURE|P_COMMA,
#ifdef FEAT_SYN_HL #ifdef FEAT_SPELL
(char_u *)&p_spf, PV_SPF, (char_u *)&p_spf, PV_SPF,
{(char_u *)"", (char_u *)0L} {(char_u *)"", (char_u *)0L}
#else #else
@@ -2223,7 +2245,7 @@ static struct vimoption
#endif #endif
}, },
{"spelllang", "spl", P_STRING|P_ALLOCED|P_VI_DEF|P_COMMA|P_RBUF|P_EXPAND, {"spelllang", "spl", P_STRING|P_ALLOCED|P_VI_DEF|P_COMMA|P_RBUF|P_EXPAND,
#ifdef FEAT_SYN_HL #ifdef FEAT_SPELL
(char_u *)&p_spl, PV_SPL, (char_u *)&p_spl, PV_SPL,
{(char_u *)"en", (char_u *)0L} {(char_u *)"en", (char_u *)0L}
#else #else
@@ -2232,7 +2254,7 @@ static struct vimoption
#endif #endif
}, },
{"spellsuggest", "sps", P_STRING|P_VI_DEF|P_EXPAND|P_SECURE, {"spellsuggest", "sps", P_STRING|P_VI_DEF|P_EXPAND|P_SECURE,
#ifdef FEAT_SYN_HL #ifdef FEAT_SPELL
(char_u *)&p_sps, PV_NONE, (char_u *)&p_sps, PV_NONE,
{(char_u *)"best", (char_u *)0L} {(char_u *)"best", (char_u *)0L}
#else #else
@@ -2808,7 +2830,7 @@ static char_u *set_chars_option __ARGS((char_u **varp));
#ifdef FEAT_CLIPBOARD #ifdef FEAT_CLIPBOARD
static char_u *check_clipboard_option __ARGS((void)); static char_u *check_clipboard_option __ARGS((void));
#endif #endif
#ifdef FEAT_SYN_HL #ifdef FEAT_SPELL
static char_u *compile_cap_prog __ARGS((buf_T *buf)); static char_u *compile_cap_prog __ARGS((buf_T *buf));
#endif #endif
#ifdef FEAT_EVAL #ifdef FEAT_EVAL
@@ -3069,7 +3091,7 @@ set_init_1()
/* Must be before option_expand(), because that one needs vim_isIDc() */ /* Must be before option_expand(), because that one needs vim_isIDc() */
didset_options(); didset_options();
#ifdef FEAT_SYN_HL #ifdef FEAT_SPELL
/* Use the current chartab for the generic chartab. */ /* Use the current chartab for the generic chartab. */
init_spell_chartab(); init_spell_chartab();
#endif #endif
@@ -4866,7 +4888,7 @@ option_expand(opt_idx, val)
*/ */
expand_env_esc(val, NameBuff, MAXPATHL, expand_env_esc(val, NameBuff, MAXPATHL,
(char_u **)options[opt_idx].var == &p_tags, (char_u **)options[opt_idx].var == &p_tags,
#ifdef FEAT_SYN_HL #ifdef FEAT_SPELL
(char_u **)options[opt_idx].var == &p_sps ? (char_u *)"file:" : (char_u **)options[opt_idx].var == &p_sps ? (char_u *)"file:" :
#endif #endif
NULL); NULL);
@@ -4902,7 +4924,7 @@ didset_options()
#if defined(FEAT_MOUSE) && (defined(UNIX) || defined(VMS)) #if defined(FEAT_MOUSE) && (defined(UNIX) || defined(VMS))
(void)opt_strings_flags(p_ttym, p_ttym_values, &ttym_flags, FALSE); (void)opt_strings_flags(p_ttym, p_ttym_values, &ttym_flags, FALSE);
#endif #endif
#ifdef FEAT_SYN_HL #ifdef FEAT_SPELL
(void)spell_check_msm(); (void)spell_check_msm();
(void)spell_check_sps(); (void)spell_check_sps();
(void)compile_cap_prog(curbuf); (void)compile_cap_prog(curbuf);
@@ -4981,6 +5003,8 @@ check_buf_options(buf)
#endif #endif
#ifdef FEAT_SYN_HL #ifdef FEAT_SYN_HL
check_string_option(&buf->b_p_syn); check_string_option(&buf->b_p_syn);
#endif
#ifdef FEAT_SPELL
check_string_option(&buf->b_p_spc); check_string_option(&buf->b_p_spc);
check_string_option(&buf->b_p_spf); check_string_option(&buf->b_p_spf);
check_string_option(&buf->b_p_spl); check_string_option(&buf->b_p_spl);
@@ -6115,7 +6139,7 @@ did_set_string_option(opt_idx, varp, new_value_alloced, oldval, errbuf,
errmsg = check_clipboard_option(); errmsg = check_clipboard_option();
#endif #endif
#ifdef FEAT_SYN_HL #ifdef FEAT_SPELL
/* When 'spelllang' or 'spellfile' is set and there is a window for this /* When 'spelllang' or 'spellfile' is set and there is a window for this
* buffer in which 'spell' is set load the wordlists. */ * buffer in which 'spell' is set load the wordlists. */
else if (varp == &(curbuf->b_p_spl) || varp == &(curbuf->b_p_spf)) else if (varp == &(curbuf->b_p_spl) || varp == &(curbuf->b_p_spf))
@@ -6537,7 +6561,7 @@ did_set_string_option(opt_idx, varp, new_value_alloced, oldval, errbuf,
curbuf->b_fname, TRUE, curbuf); curbuf->b_fname, TRUE, curbuf);
} }
#endif #endif
#ifdef FEAT_SYN_HL #ifdef FEAT_SPELL
if (varp == &(curbuf->b_p_spl)) if (varp == &(curbuf->b_p_spl))
{ {
char_u fname[200]; char_u fname[200];
@@ -6837,7 +6861,7 @@ check_clipboard_option()
} }
#endif #endif
#ifdef FEAT_SYN_HL #ifdef FEAT_SPELL
/* /*
* Set curbuf->b_cap_prog to the regexp program for 'spellcapcheck'. * Set curbuf->b_cap_prog to the regexp program for 'spellcapcheck'.
* Return error message when failed, NULL when OK. * Return error message when failed, NULL when OK.
@@ -7043,7 +7067,7 @@ set_bool_option(opt_idx, varp, value, opt_flags)
/* when 'ignorecase' is set or reset and 'hlsearch' is set, redraw */ /* when 'ignorecase' is set or reset and 'hlsearch' is set, redraw */
else if ((int *)varp == &p_ic && p_hls) else if ((int *)varp == &p_ic && p_hls)
{ {
redraw_all_later(NOT_VALID); redraw_all_later(SOME_VALID);
} }
#ifdef FEAT_SEARCH_EXTRA #ifdef FEAT_SEARCH_EXTRA
@@ -7225,7 +7249,7 @@ set_bool_option(opt_idx, varp, value, opt_flags)
} }
#endif #endif
#ifdef FEAT_SYN_HL #ifdef FEAT_SPELL
/* 'spell' */ /* 'spell' */
else if ((int *)varp == &curwin->w_p_spell) else if ((int *)varp == &curwin->w_p_spell)
{ {
@@ -8807,9 +8831,13 @@ get_varp(p)
case PV_ARAB: return (char_u *)&(curwin->w_p_arab); case PV_ARAB: return (char_u *)&(curwin->w_p_arab);
#endif #endif
case PV_LIST: return (char_u *)&(curwin->w_p_list); case PV_LIST: return (char_u *)&(curwin->w_p_list);
#ifdef FEAT_SYN_HL #ifdef FEAT_SPELL
case PV_SPELL: return (char_u *)&(curwin->w_p_spell); case PV_SPELL: return (char_u *)&(curwin->w_p_spell);
#endif #endif
#ifdef FEAT_SYN_HL
case PV_CUC: return (char_u *)&(curwin->w_p_cuc);
case PV_CUL: return (char_u *)&(curwin->w_p_cul);
#endif
#ifdef FEAT_DIFF #ifdef FEAT_DIFF
case PV_DIFF: return (char_u *)&(curwin->w_p_diff); case PV_DIFF: return (char_u *)&(curwin->w_p_diff);
#endif #endif
@@ -8941,10 +8969,12 @@ get_varp(p)
case PV_SWF: return (char_u *)&(curbuf->b_p_swf); case PV_SWF: return (char_u *)&(curbuf->b_p_swf);
#ifdef FEAT_SYN_HL #ifdef FEAT_SYN_HL
case PV_SMC: return (char_u *)&(curbuf->b_p_smc); case PV_SMC: return (char_u *)&(curbuf->b_p_smc);
case PV_SYN: return (char_u *)&(curbuf->b_p_syn);
#endif
#ifdef FEAT_SPELL
case PV_SPC: return (char_u *)&(curbuf->b_p_spc); case PV_SPC: return (char_u *)&(curbuf->b_p_spc);
case PV_SPF: return (char_u *)&(curbuf->b_p_spf); case PV_SPF: return (char_u *)&(curbuf->b_p_spf);
case PV_SPL: return (char_u *)&(curbuf->b_p_spl); case PV_SPL: return (char_u *)&(curbuf->b_p_spl);
case PV_SYN: return (char_u *)&(curbuf->b_p_syn);
#endif #endif
case PV_SW: return (char_u *)&(curbuf->b_p_sw); case PV_SW: return (char_u *)&(curbuf->b_p_sw);
case PV_TS: return (char_u *)&(curbuf->b_p_ts); case PV_TS: return (char_u *)&(curbuf->b_p_ts);
@@ -9025,9 +9055,13 @@ copy_winopt(from, to)
#ifdef FEAT_SCROLLBIND #ifdef FEAT_SCROLLBIND
to->wo_scb = from->wo_scb; to->wo_scb = from->wo_scb;
#endif #endif
#ifdef FEAT_SYN_HL #ifdef FEAT_SPELL
to->wo_spell = from->wo_spell; to->wo_spell = from->wo_spell;
#endif #endif
#ifdef FEAT_SYN_HL
to->wo_cuc = from->wo_cuc;
to->wo_cul = from->wo_cul;
#endif
#ifdef FEAT_DIFF #ifdef FEAT_DIFF
to->wo_diff = from->wo_diff; to->wo_diff = from->wo_diff;
#endif #endif
@@ -9259,6 +9293,8 @@ buf_copy_options(buf, flags)
/* Don't copy 'syntax', it must be set */ /* Don't copy 'syntax', it must be set */
buf->b_p_syn = empty_option; buf->b_p_syn = empty_option;
buf->b_p_smc = p_smc; buf->b_p_smc = p_smc;
#endif
#ifdef FEAT_SPELL
buf->b_p_spc = vim_strsave(p_spc); buf->b_p_spc = vim_strsave(p_spc);
(void)compile_cap_prog(buf); (void)compile_cap_prog(buf);
buf->b_p_spf = vim_strsave(p_spf); buf->b_p_spf = vim_strsave(p_spf);
@@ -9577,7 +9613,7 @@ set_context_in_set_cmd(xp, arg, opt_flags)
} }
} }
#ifdef FEAT_SYN_HL #ifdef FEAT_SPELL
/* for 'spellsuggest' start at "file:" */ /* for 'spellsuggest' start at "file:" */
if (options[opt_idx].var == (char_u *)&p_sps if (options[opt_idx].var == (char_u *)&p_sps
&& STRNCMP(p, "file:", 5) == 0) && STRNCMP(p, "file:", 5) == 0)

View File

@@ -596,7 +596,7 @@ EXTERN long p_mmt; /* 'maxmemtot' */
#ifdef FEAT_MENU #ifdef FEAT_MENU
EXTERN long p_mis; /* 'menuitems' */ EXTERN long p_mis; /* 'menuitems' */
#endif #endif
#ifdef FEAT_SYN_HL #ifdef FEAT_SPELL
EXTERN char_u *p_msm; /* 'mkspellmem' */ EXTERN char_u *p_msm; /* 'mkspellmem' */
#endif #endif
EXTERN long p_mls; /* 'modelines' */ EXTERN long p_mls; /* 'modelines' */
@@ -718,7 +718,7 @@ EXTERN long p_tpm; /* 'tabpagemax' */
EXTERN char_u *p_tal; /* 'tabline' */ EXTERN char_u *p_tal; /* 'tabline' */
# endif # endif
#endif #endif
#ifdef FEAT_SYN_HL #ifdef FEAT_SPELL
EXTERN char_u *p_sps; /* 'spellsuggest' */ EXTERN char_u *p_sps; /* 'spellsuggest' */
#endif #endif
#ifdef FEAT_VERTSPLIT #ifdef FEAT_VERTSPLIT
@@ -962,10 +962,12 @@ enum
#endif #endif
#ifdef FEAT_SYN_HL #ifdef FEAT_SYN_HL
, BV_SMC , BV_SMC
, BV_SYN
#endif
#ifdef FEAT_SPELL
, BV_SPC , BV_SPC
, BV_SPF , BV_SPF
, BV_SPL , BV_SPL
, BV_SYN
#endif #endif
, BV_STS , BV_STS
#ifdef FEAT_SEARCHPATH #ifdef FEAT_SEARCHPATH
@@ -1027,10 +1029,12 @@ enum
, WV_SCBIND , WV_SCBIND
#endif #endif
, WV_SCROLL , WV_SCROLL
#ifdef FEAT_SYN_HL #ifdef FEAT_SPELL
, WV_SPELL , WV_SPELL
, WV_SPC #endif
, WV_SYN #ifdef FEAT_SYN_HL
, WV_CUC
, WV_CUL
#endif #endif
#ifdef FEAT_STL_OPT #ifdef FEAT_STL_OPT
, WV_STL , WV_STL

View File

@@ -189,9 +189,15 @@ typedef struct
#endif #endif
long wo_scr; long wo_scr;
#define w_p_scr w_onebuf_opt.wo_scr /* 'scroll' */ #define w_p_scr w_onebuf_opt.wo_scr /* 'scroll' */
#ifdef FEAT_SYN_HL #ifdef FEAT_SPELL
int wo_spell; int wo_spell;
#define w_p_spell w_onebuf_opt.wo_spell /* 'spell' */ # define w_p_spell w_onebuf_opt.wo_spell /* 'spell' */
#endif
#ifdef FEAT_SYN_HL
int wo_cuc;
# define w_p_cuc w_onebuf_opt.wo_cuc /* 'cursorcolumn' */
int wo_cul;
# define w_p_cul w_onebuf_opt.wo_cul /* 'cursorline' */
#endif #endif
#ifdef FEAT_STL_OPT #ifdef FEAT_STL_OPT
char_u *wo_stl; char_u *wo_stl;
@@ -1099,7 +1105,7 @@ struct dictvar_S
#define SYNSPL_NOTOP 2 /* don't spell check toplevel text */ #define SYNSPL_NOTOP 2 /* don't spell check toplevel text */
/* avoid #ifdefs for when b_spell is not available */ /* avoid #ifdefs for when b_spell is not available */
#ifdef FEAT_SYN_HL #ifdef FEAT_SPELL
# define B_SPELL(buf) ((buf)->b_spell) # define B_SPELL(buf) ((buf)->b_spell)
#else #else
# define B_SPELL(buf) (0) # define B_SPELL(buf) (0)
@@ -1393,6 +1399,8 @@ struct file_buffer
#ifdef FEAT_SYN_HL #ifdef FEAT_SYN_HL
long b_p_smc; /* 'synmaxcol' */ long b_p_smc; /* 'synmaxcol' */
char_u *b_p_syn; /* 'syntax' */ char_u *b_p_syn; /* 'syntax' */
#endif
#ifdef FEAT_SPELL
char_u *b_p_spc; /* 'spellcapcheck' */ char_u *b_p_spc; /* 'spellcapcheck' */
regprog_T *b_cap_prog; /* program for 'spellcapcheck' */ regprog_T *b_cap_prog; /* program for 'spellcapcheck' */
char_u *b_p_spf; /* 'spellfile' */ char_u *b_p_spf; /* 'spellfile' */
@@ -1454,7 +1462,7 @@ struct file_buffer
*/ */
int b_help; /* TRUE for help file buffer (when set b_p_bt int b_help; /* TRUE for help file buffer (when set b_p_bt
is "help") */ is "help") */
#ifdef FEAT_SYN_HL #ifdef FEAT_SPELL
int b_spell; /* TRUE for a spell file buffer, most fields int b_spell; /* TRUE for a spell file buffer, most fields
are not used! Use the B_SPELL macro to are not used! Use the B_SPELL macro to
access b_spell without #ifdef. */ access b_spell without #ifdef. */
@@ -1530,14 +1538,16 @@ struct file_buffer
int b_sst_freecount; int b_sst_freecount;
linenr_T b_sst_check_lnum; linenr_T b_sst_check_lnum;
short_u b_sst_lasttick; /* last display tick */ short_u b_sst_lasttick; /* last display tick */
#endif /* FEAT_SYN_HL */
#ifdef FEAT_SPELL
/* for spell checking */ /* for spell checking */
garray_T b_langp; /* list of pointers to slang_T, see spell.c */ garray_T b_langp; /* list of pointers to slang_T, see spell.c */
char_u b_spell_ismw[256];/* flags: is midword char */ char_u b_spell_ismw[256];/* flags: is midword char */
# ifdef FEAT_MBYTE # ifdef FEAT_MBYTE
char_u *b_spell_ismw_mb; /* multi-byte midword chars */ char_u *b_spell_ismw_mb; /* multi-byte midword chars */
# endif # endif
#endif /* FEAT_SYN_HL */ #endif
#ifdef FEAT_SIGNS #ifdef FEAT_SIGNS
signlist_T *b_signlist; /* list of signs to draw */ signlist_T *b_signlist; /* list of signs to draw */