0
0
mirror of https://github.com/vim/vim.git synced 2025-09-27 04:14:06 -04:00

Add the conceal patch from Vince Negri.

This commit is contained in:
Bram Moolenaar
2010-06-05 23:22:07 +02:00
parent 945e2dbb63
commit 860cae1cec
40 changed files with 1737 additions and 698 deletions

View File

@@ -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.
*/