diff options
author | Bram Moolenaar <Bram@vim.org> | 2010-06-05 23:22:07 +0200 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2010-06-05 23:22:07 +0200 |
commit | 860cae1cec85aeb06668a2b071727c43869acf15 (patch) | |
tree | 8f7b62b69f4a7d3340902178927bbc3f9d24cc3e /src/eval.c | |
parent | 945e2dbb633ed29b697a8d4eea51672e3c11143b (diff) |
Add the conceal patch from Vince Negri.
Diffstat (limited to 'src/eval.c')
-rw-r--r-- | src/eval.c | 48 |
1 files changed, 45 insertions, 3 deletions
diff --git a/src/eval.c b/src/eval.c index e777d32558..ca9389fb39 100644 --- a/src/eval.c +++ b/src/eval.c @@ -3884,6 +3884,11 @@ get_user_var_name(xp, idx) ++hi; return cat_prefix_varname('w', hi->hi_key); } + if (wdone == ht->ht_used) + { + ++wdone; + return (char_u *)"w:ownsyntax"; + } #ifdef FEAT_WINDOWS /* t: variables */ @@ -9389,6 +9394,9 @@ f_cursor(argvars, rettv) typval_T *rettv; { long line, col; +#ifdef FEAT_CONCEAL + linenr_T oldline = curwin->w_cursor.lnum; +#endif #ifdef FEAT_VIRTUALEDIT long coladd = 0; #endif @@ -9438,6 +9446,13 @@ f_cursor(argvars, rettv) #endif curwin->w_set_curswant = TRUE; +#ifdef FEAT_CONCEAL + if (curwin->w_p_conceal && oldline != curwin->w_cursor.lnum) + { + update_single_line(curwin, oldline); + update_single_line(curwin, curwin->w_cursor.lnum); + } +#endif rettv->vval.v_number = 0; } @@ -11722,12 +11737,18 @@ f_has(argvars, rettv) #ifdef FEAT_COMMENTS "comments", #endif +#ifdef FEAT_CONCEAL + "conceal", +#endif #ifdef FEAT_CRYPT "cryptv", #endif #ifdef FEAT_CSCOPE "cscope", #endif +#ifdef FEAT_CURSORBIND + "cursorbind", +#endif #ifdef CURSOR_SHAPE "cursorshape", #endif @@ -12138,7 +12159,7 @@ f_has(argvars, rettv) #endif #ifdef FEAT_SYN_HL else if (STRICMP(name, "syntax_items") == 0) - n = syntax_present(curbuf); + n = syntax_present(curwin); #endif #if defined(WIN3264) else if (STRICMP(name, "win95") == 0) @@ -15103,6 +15124,15 @@ search_cmn(argvars, match_pos, flagsp) /* If 'n' flag is used: restore cursor position. */ if (flags & SP_NOMOVE) curwin->w_cursor = save_cursor; +#ifdef FEAT_CONCEAL + else if (curwin->w_p_conceal + && save_cursor.lnum != curwin->w_cursor.lnum) + { + curwin->w_set_curswant = TRUE; + update_single_line(curwin, save_cursor.lnum); + update_single_line(curwin, curwin->w_cursor.lnum); + } +#endif else curwin->w_set_curswant = TRUE; theend: @@ -16329,7 +16359,7 @@ f_spellbadword(argvars, rettv) if (len != 0) word = ml_get_cursor(); } - else if (curwin->w_p_spell && *curbuf->b_p_spl != NUL) + else if (curwin->w_p_spell && *curbuf->b_s.b_p_spl != NUL) { char_u *str = get_tv_string_chk(&argvars[0]); int capcol = -1; @@ -16382,7 +16412,7 @@ f_spellsuggest(argvars, rettv) return; #ifdef FEAT_SPELL - if (curwin->w_p_spell && *curbuf->b_p_spl != NUL) + if (curwin->w_p_spell && *curwin->w_s->b_p_spl != NUL) { str = get_tv_string(&argvars[0]); if (argvars[1].v_type != VAR_UNKNOWN) @@ -18728,6 +18758,18 @@ get_var_tv(name, len, rettv, verbose) tv = &atv; } + if (STRCMP(name, "w:ownsyntax") == 0) + { + atv.v_type = VAR_NUMBER; +#ifdef FEAT_SYN_HL + atv.vval.v_number = (curwin->w_s != &curwin->w_buffer->b_s) ? 1 : 0; +#else + atv.vval.v_number = 0; +#endif + tv = &atv; + } + + /* * Check for user-defined variables. */ |