mirror of
https://github.com/neovim/neovim.git
synced 2025-02-25 18:55:25 -06:00
Merge remote-tracking branch 'upstream/master'
This commit is contained in:
commit
76606b6bc5
@ -6747,19 +6747,19 @@ A jump table for the options with a short description can be found at |Q_op|.
|
|||||||
*'winhighlight'* *'winhl'*
|
*'winhighlight'* *'winhl'*
|
||||||
'winhighlight' 'winhl' string (default empty)
|
'winhighlight' 'winhl' string (default empty)
|
||||||
local to window
|
local to window
|
||||||
Window-local highlights. Comma-delimited list of |group-name| pairs
|
Window-local highlights. Comma-delimited list of highlight
|
||||||
"{hl-builtin}:{hl-group},..." where each {hl-builtin} is a group (from
|
|group-name| pairs "{hl-builtin}:{hl},..." where each {hl-builtin} is
|
||||||
|highlight-groups|) to be overridden by {hl-group} in the window where
|
a built-in |highlight-groups| item to be overridden by {hl} group in
|
||||||
this option was set. Only builting ui highlights are supported, not
|
the window. Only built-in |highlight-groups| are supported, not
|
||||||
syntax highlighting. For that purpose, use |:ownsyntax|.
|
syntax highlighting (use |:ownsyntax| for that).
|
||||||
|
|
||||||
Most highlights occuring within the frame of a window are supported.
|
|
||||||
Highlights of vertical separators are determined by the window to the
|
Highlights of vertical separators are determined by the window to the
|
||||||
left of the separator. The highlight of a tabpage in |tabline| is
|
left of the separator. The highlight of a tabpage in |tabline| is
|
||||||
determined by the last focused window in the tabpage. Highlights of
|
determine by the last-focused window of the tabpage. Highlights of
|
||||||
the popupmenu are determined by the current window. Highlights in the
|
the popupmenu are determined by the current window. Highlights in the
|
||||||
message area are not overridable. Example for overriding the
|
message area cannot be overridden.
|
||||||
backgrond color: >
|
|
||||||
|
Example: show a different color for non-current windows: >
|
||||||
set winhighlight=Normal:MyNormal,NormalNC:MyNormalNC
|
set winhighlight=Normal:MyNormal,NormalNC:MyNormalNC
|
||||||
<
|
<
|
||||||
*'winfixheight'* *'wfh'* *'nowinfixheight'* *'nowfh'*
|
*'winfixheight'* *'wfh'* *'nowinfixheight'* *'nowfh'*
|
||||||
|
@ -280,6 +280,10 @@ other arguments if used).
|
|||||||
|
|
||||||
|input()| and |inputdialog()| support user-defined cmdline highlighting.
|
|input()| and |inputdialog()| support user-defined cmdline highlighting.
|
||||||
|
|
||||||
|
Highlight groups:
|
||||||
|
|hl-ColorColumn|, |hl-CursorColumn|, |hl-CursorLine| are lower priority than
|
||||||
|
(overridden by) most other highlight groups.
|
||||||
|
|
||||||
==============================================================================
|
==============================================================================
|
||||||
5. Missing legacy features *nvim-features-missing*
|
5. Missing legacy features *nvim-features-missing*
|
||||||
|
|
||||||
|
@ -3069,13 +3069,9 @@ static bool ti_change(char_u *str, char_u **last)
|
|||||||
/// Set current window title
|
/// Set current window title
|
||||||
void resettitle(void)
|
void resettitle(void)
|
||||||
{
|
{
|
||||||
if (p_icon) {
|
ui_call_set_icon(cstr_as_string((char *)lasticon));
|
||||||
ui_call_set_icon(cstr_as_string((char *)lasticon));
|
ui_call_set_title(cstr_as_string((char *)lasttitle));
|
||||||
}
|
ui_flush();
|
||||||
if (p_title || p_icon) {
|
|
||||||
ui_call_set_title(cstr_as_string((char *)lasttitle));
|
|
||||||
ui_flush();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
# if defined(EXITFREE)
|
# if defined(EXITFREE)
|
||||||
|
@ -6733,6 +6733,39 @@ static void prepare_assert_error(garray_T *gap)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Append "str" to "gap", escaping unprintable characters.
|
||||||
|
// Changes NL to \n, CR to \r, etc.
|
||||||
|
static void ga_concat_esc(garray_T *gap, char_u *str)
|
||||||
|
{
|
||||||
|
char_u *p;
|
||||||
|
char_u buf[NUMBUFLEN];
|
||||||
|
|
||||||
|
if (str == NULL) {
|
||||||
|
ga_concat(gap, (char_u *)"NULL");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
for (p = str; *p != NUL; p++) {
|
||||||
|
switch (*p) {
|
||||||
|
case BS: ga_concat(gap, (char_u *)"\\b"); break;
|
||||||
|
case ESC: ga_concat(gap, (char_u *)"\\e"); break;
|
||||||
|
case FF: ga_concat(gap, (char_u *)"\\f"); break;
|
||||||
|
case NL: ga_concat(gap, (char_u *)"\\n"); break;
|
||||||
|
case TAB: ga_concat(gap, (char_u *)"\\t"); break;
|
||||||
|
case CAR: ga_concat(gap, (char_u *)"\\r"); break;
|
||||||
|
case '\\': ga_concat(gap, (char_u *)"\\\\"); break;
|
||||||
|
default:
|
||||||
|
if (*p < ' ') {
|
||||||
|
vim_snprintf((char *)buf, NUMBUFLEN, "\\x%02x", *p);
|
||||||
|
ga_concat(gap, buf);
|
||||||
|
} else {
|
||||||
|
ga_append(gap, *p);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Fill "gap" with information about an assert error.
|
// Fill "gap" with information about an assert error.
|
||||||
static void fill_assert_error(garray_T *gap, typval_T *opt_msg_tv,
|
static void fill_assert_error(garray_T *gap, typval_T *opt_msg_tv,
|
||||||
char_u *exp_str, typval_T *exp_tv,
|
char_u *exp_str, typval_T *exp_tv,
|
||||||
@ -6753,11 +6786,11 @@ static void fill_assert_error(garray_T *gap, typval_T *opt_msg_tv,
|
|||||||
ga_concat(gap, (char_u *)"Expected ");
|
ga_concat(gap, (char_u *)"Expected ");
|
||||||
}
|
}
|
||||||
if (exp_str == NULL) {
|
if (exp_str == NULL) {
|
||||||
tofree = (char_u *) encode_tv2string(exp_tv, NULL);
|
tofree = (char_u *)encode_tv2string(exp_tv, NULL);
|
||||||
ga_concat(gap, tofree);
|
ga_concat_esc(gap, tofree);
|
||||||
xfree(tofree);
|
xfree(tofree);
|
||||||
} else {
|
} else {
|
||||||
ga_concat(gap, exp_str);
|
ga_concat_esc(gap, exp_str);
|
||||||
}
|
}
|
||||||
if (atype != ASSERT_NOTEQUAL) {
|
if (atype != ASSERT_NOTEQUAL) {
|
||||||
if (atype == ASSERT_MATCH) {
|
if (atype == ASSERT_MATCH) {
|
||||||
@ -6768,7 +6801,7 @@ static void fill_assert_error(garray_T *gap, typval_T *opt_msg_tv,
|
|||||||
ga_concat(gap, (char_u *)" but got ");
|
ga_concat(gap, (char_u *)" but got ");
|
||||||
}
|
}
|
||||||
tofree = (char_u *)encode_tv2string(got_tv, NULL);
|
tofree = (char_u *)encode_tv2string(got_tv, NULL);
|
||||||
ga_concat(gap, tofree);
|
ga_concat_esc(gap, tofree);
|
||||||
xfree(tofree);
|
xfree(tofree);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -734,16 +734,20 @@ static int cin_ispreproc(char_u *s)
|
|||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/// Return TRUE if line "*pp" at "*lnump" is a preprocessor statement or a
|
||||||
* Return TRUE if line "*pp" at "*lnump" is a preprocessor statement or a
|
/// continuation line of a preprocessor statement. Decrease "*lnump" to the
|
||||||
* continuation line of a preprocessor statement. Decrease "*lnump" to the
|
/// start and return the line in "*pp".
|
||||||
* start and return the line in "*pp".
|
/// Put the amount of indent in "*amount".
|
||||||
*/
|
static int cin_ispreproc_cont(char_u **pp, linenr_T *lnump, int *amount)
|
||||||
static int cin_ispreproc_cont(char_u **pp, linenr_T *lnump)
|
|
||||||
{
|
{
|
||||||
char_u *line = *pp;
|
char_u *line = *pp;
|
||||||
linenr_T lnum = *lnump;
|
linenr_T lnum = *lnump;
|
||||||
int retval = FALSE;
|
int retval = false;
|
||||||
|
int candidate_amount = *amount;
|
||||||
|
|
||||||
|
if (*line != NUL && line[STRLEN(line) - 1] == '\\') {
|
||||||
|
candidate_amount = get_indent_lnum(lnum);
|
||||||
|
}
|
||||||
|
|
||||||
for (;; ) {
|
for (;; ) {
|
||||||
if (cin_ispreproc(line)) {
|
if (cin_ispreproc(line)) {
|
||||||
@ -758,8 +762,12 @@ static int cin_ispreproc_cont(char_u **pp, linenr_T *lnump)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (lnum != *lnump)
|
if (lnum != *lnump) {
|
||||||
*pp = ml_get(*lnump);
|
*pp = ml_get(*lnump);
|
||||||
|
}
|
||||||
|
if (retval) {
|
||||||
|
*amount = candidate_amount;
|
||||||
|
}
|
||||||
return retval;
|
return retval;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1994,10 +2002,12 @@ int get_c_indent(void)
|
|||||||
amount = -1;
|
amount = -1;
|
||||||
for (lnum = cur_curpos.lnum - 1; lnum > our_paren_pos.lnum; --lnum) {
|
for (lnum = cur_curpos.lnum - 1; lnum > our_paren_pos.lnum; --lnum) {
|
||||||
l = skipwhite(ml_get(lnum));
|
l = skipwhite(ml_get(lnum));
|
||||||
if (cin_nocode(l)) /* skip comment lines */
|
if (cin_nocode(l)) { // skip comment lines
|
||||||
continue;
|
continue;
|
||||||
if (cin_ispreproc_cont(&l, &lnum))
|
}
|
||||||
continue; /* ignore #define, #if, etc. */
|
if (cin_ispreproc_cont(&l, &lnum, &amount)) {
|
||||||
|
continue; // ignore #define, #if, etc.
|
||||||
|
}
|
||||||
curwin->w_cursor.lnum = lnum;
|
curwin->w_cursor.lnum = lnum;
|
||||||
|
|
||||||
/* Skip a comment or raw string. XXX */
|
/* Skip a comment or raw string. XXX */
|
||||||
@ -2353,15 +2363,14 @@ int get_c_indent(void)
|
|||||||
* up with it.
|
* up with it.
|
||||||
*/
|
*/
|
||||||
if (curwin->w_cursor.lnum <= ourscope) {
|
if (curwin->w_cursor.lnum <= ourscope) {
|
||||||
/* we reached end of scope:
|
// We reached end of scope:
|
||||||
* if looking for an enum or structure initialization
|
// If looking for a enum or structure initialization
|
||||||
* go further back:
|
// go further back:
|
||||||
* if it is an initializer (enum xxx or xxx =), then
|
// If it is an initializer (enum xxx or xxx =), then
|
||||||
* don't add ind_continuation, otherwise it is a variable
|
// don't add ind_continuation, otherwise it is a variable
|
||||||
* declaration:
|
// declaration:
|
||||||
* int x,
|
// int x,
|
||||||
* here; <-- add ind_continuation
|
// here; <-- add ind_continuation
|
||||||
*/
|
|
||||||
if (lookfor == LOOKFOR_ENUM_OR_INIT) {
|
if (lookfor == LOOKFOR_ENUM_OR_INIT) {
|
||||||
if (curwin->w_cursor.lnum == 0
|
if (curwin->w_cursor.lnum == 0
|
||||||
|| curwin->w_cursor.lnum
|
|| curwin->w_cursor.lnum
|
||||||
@ -2389,11 +2398,12 @@ int get_c_indent(void)
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
//
|
||||||
* Skip preprocessor directives and blank lines.
|
// Skip preprocessor directives and blank lines.
|
||||||
*/
|
//
|
||||||
if (cin_ispreproc_cont(&l, &curwin->w_cursor.lnum))
|
if (cin_ispreproc_cont(&l, &curwin->w_cursor.lnum, &amount)) {
|
||||||
continue;
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
if (cin_nocode(l))
|
if (cin_nocode(l))
|
||||||
continue;
|
continue;
|
||||||
@ -2497,9 +2507,10 @@ int get_c_indent(void)
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Skip preprocessor directives and blank lines. */
|
// Skip preprocessor directives and blank lines.
|
||||||
if (cin_ispreproc_cont(&l, &curwin->w_cursor.lnum))
|
if (cin_ispreproc_cont(&l, &curwin->w_cursor.lnum, &amount)) {
|
||||||
continue;
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
/* Finally the actual check for "namespace". */
|
/* Finally the actual check for "namespace". */
|
||||||
if (cin_is_cpp_namespace(l)) {
|
if (cin_is_cpp_namespace(l)) {
|
||||||
@ -2662,9 +2673,10 @@ int get_c_indent(void)
|
|||||||
* unlocked it)
|
* unlocked it)
|
||||||
*/
|
*/
|
||||||
l = get_cursor_line_ptr();
|
l = get_cursor_line_ptr();
|
||||||
if (cin_ispreproc_cont(&l, &curwin->w_cursor.lnum)
|
if (cin_ispreproc_cont(&l, &curwin->w_cursor.lnum, &amount)
|
||||||
|| cin_nocode(l))
|
|| cin_nocode(l)) {
|
||||||
continue;
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Are we at the start of a cpp base class declaration or
|
* Are we at the start of a cpp base class declaration or
|
||||||
@ -3309,11 +3321,12 @@ term_again:
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
//
|
||||||
* Skip preprocessor directives and blank lines.
|
// Skip preprocessor directives and blank lines.
|
||||||
*/
|
//
|
||||||
if (cin_ispreproc_cont(&l, &curwin->w_cursor.lnum))
|
if (cin_ispreproc_cont(&l, &curwin->w_cursor.lnum, &amount)) {
|
||||||
continue;
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
if (cin_nocode(l))
|
if (cin_nocode(l))
|
||||||
continue;
|
continue;
|
||||||
@ -3405,9 +3418,10 @@ term_again:
|
|||||||
|
|
||||||
while (curwin->w_cursor.lnum > 1) {
|
while (curwin->w_cursor.lnum > 1) {
|
||||||
look = ml_get(--curwin->w_cursor.lnum);
|
look = ml_get(--curwin->w_cursor.lnum);
|
||||||
if (!(cin_nocode(look) || cin_ispreproc_cont(
|
if (!(cin_nocode(look)
|
||||||
&look, &curwin->w_cursor.lnum)))
|
|| cin_ispreproc_cont(&look, &curwin->w_cursor.lnum, &amount))) {
|
||||||
break;
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (curwin->w_cursor.lnum > 0
|
if (curwin->w_cursor.lnum > 0
|
||||||
&& cin_ends_in(look, (char_u *)"}", NULL))
|
&& cin_ends_in(look, (char_u *)"}", NULL))
|
||||||
|
@ -2201,16 +2201,17 @@ win_line (
|
|||||||
int change_end = -1; /* last col of changed area */
|
int change_end = -1; /* last col of changed area */
|
||||||
colnr_T trailcol = MAXCOL; /* start of trailing spaces */
|
colnr_T trailcol = MAXCOL; /* start of trailing spaces */
|
||||||
int need_showbreak = false; // overlong line, skip first x chars
|
int need_showbreak = false; // overlong line, skip first x chars
|
||||||
int line_attr = 0; /* attribute for the whole line */
|
int line_attr = 0; // attribute for the whole line
|
||||||
matchitem_T *cur; /* points to the match list */
|
int line_attr_low_priority = 0; // current line, lowest priority
|
||||||
match_T *shl; /* points to search_hl or a match */
|
matchitem_T *cur; // points to the match list
|
||||||
int shl_flag; /* flag to indicate whether search_hl
|
match_T *shl; // points to search_hl or a match
|
||||||
has been processed or not */
|
int shl_flag; // flag to indicate whether search_hl
|
||||||
int prevcol_hl_flag; /* flag to indicate whether prevcol
|
// has been processed or not
|
||||||
equals startcol of search_hl or one
|
int prevcol_hl_flag; // flag to indicate whether prevcol
|
||||||
of the matches */
|
// equals startcol of search_hl or one
|
||||||
int prev_c = 0; /* previous Arabic character */
|
// of the matches
|
||||||
int prev_c1 = 0; /* first composing char for prev_c */
|
int prev_c = 0; // previous Arabic character
|
||||||
|
int prev_c1 = 0; // first composing char for prev_c
|
||||||
int did_line_attr = 0;
|
int did_line_attr = 0;
|
||||||
|
|
||||||
bool search_attr_from_match = false; // if search_attr is from :match
|
bool search_attr_from_match = false; // if search_attr is from :match
|
||||||
@ -2427,10 +2428,17 @@ win_line (
|
|||||||
filler_lines = wp->w_topfill;
|
filler_lines = wp->w_topfill;
|
||||||
filler_todo = filler_lines;
|
filler_todo = filler_lines;
|
||||||
|
|
||||||
/* If this line has a sign with line highlighting set line_attr. */
|
// 'cursorline' highlighting for the current window. Not when Visual mode is
|
||||||
|
// active, because it's not clear what is selected then.
|
||||||
|
if (wp->w_p_cul && lnum == wp->w_cursor.lnum
|
||||||
|
&& !(wp == curwin && VIsual_active)) {
|
||||||
|
line_attr_low_priority = win_hl_attr(wp, HLF_CUL);
|
||||||
|
}
|
||||||
|
|
||||||
v = buf_getsigntype(wp->w_buffer, lnum, SIGN_LINEHL);
|
v = buf_getsigntype(wp->w_buffer, lnum, SIGN_LINEHL);
|
||||||
if (v != 0)
|
if (v != 0) {
|
||||||
line_attr = sign_get_attr((int)v, TRUE);
|
line_attr = sign_get_attr((int)v, true);
|
||||||
|
}
|
||||||
|
|
||||||
// Highlight the current line in the quickfix window.
|
// Highlight the current line in the quickfix window.
|
||||||
if (bt_quickfix(wp->w_buffer) && qf_current_entry(wp) == lnum) {
|
if (bt_quickfix(wp->w_buffer) && qf_current_entry(wp) == lnum) {
|
||||||
@ -2441,7 +2449,7 @@ win_line (
|
|||||||
line_attr = hl_combine_attr(wp->w_hl_attr_normal, line_attr);
|
line_attr = hl_combine_attr(wp->w_hl_attr_normal, line_attr);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (line_attr != 0) {
|
if (line_attr_low_priority || line_attr) {
|
||||||
area_highlighting = true;
|
area_highlighting = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2663,20 +2671,6 @@ win_line (
|
|||||||
cur = cur->next;
|
cur = cur->next;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Cursor line highlighting for 'cursorline' in the current window. Not
|
|
||||||
* when Visual mode is active, because it's not clear what is selected
|
|
||||||
* then. */
|
|
||||||
if (wp->w_p_cul && lnum == wp->w_cursor.lnum
|
|
||||||
&& !(wp == curwin && VIsual_active)) {
|
|
||||||
if (line_attr != 0 && !(State & INSERT) && bt_quickfix(wp->w_buffer)
|
|
||||||
&& qf_current_entry(wp) == lnum) {
|
|
||||||
line_attr = hl_combine_attr(win_hl_attr(wp, HLF_CUL), line_attr);
|
|
||||||
} else {
|
|
||||||
line_attr = win_hl_attr(wp, HLF_CUL);
|
|
||||||
}
|
|
||||||
area_highlighting = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
off = (unsigned)(current_ScreenLine - ScreenLines);
|
off = (unsigned)(current_ScreenLine - ScreenLines);
|
||||||
col = 0;
|
col = 0;
|
||||||
if (wp->w_p_rl) {
|
if (wp->w_p_rl) {
|
||||||
@ -3594,15 +3588,15 @@ win_line (
|
|||||||
&& lcs_eol_one > 0) {
|
&& lcs_eol_one > 0) {
|
||||||
// Display a '$' after the line or highlight an extra
|
// Display a '$' after the line or highlight an extra
|
||||||
// character if the line break is included.
|
// character if the line break is included.
|
||||||
// For a diff line the highlighting continues after the
|
// For a diff line the highlighting continues after the "$".
|
||||||
// "$".
|
if (diff_hlf == (hlf_T)0
|
||||||
if (diff_hlf == (hlf_T)0 && line_attr == 0) {
|
&& line_attr == 0
|
||||||
/* In virtualedit, visual selections may extend
|
&& line_attr_low_priority == 0) {
|
||||||
* beyond end of line. */
|
// In virtualedit, visual selections may extend beyond end of line.
|
||||||
if (area_highlighting && virtual_active()
|
if (area_highlighting && virtual_active()
|
||||||
&& tocol != MAXCOL && vcol < tocol)
|
&& tocol != MAXCOL && vcol < tocol) {
|
||||||
n_extra = 0;
|
n_extra = 0;
|
||||||
else {
|
} else {
|
||||||
p_extra = at_end_str;
|
p_extra = at_end_str;
|
||||||
n_extra = 1;
|
n_extra = 1;
|
||||||
c_extra = NUL;
|
c_extra = NUL;
|
||||||
@ -3661,7 +3655,7 @@ win_line (
|
|||||||
(col < wp->w_width))) {
|
(col < wp->w_width))) {
|
||||||
c = ' ';
|
c = ' ';
|
||||||
ptr--; // put it back at the NUL
|
ptr--; // put it back at the NUL
|
||||||
} else if ((diff_hlf != (hlf_T)0 || line_attr != 0)
|
} else if ((diff_hlf != (hlf_T)0 || line_attr_low_priority || line_attr)
|
||||||
&& (wp->w_p_rl
|
&& (wp->w_p_rl
|
||||||
? (col >= 0)
|
? (col >= 0)
|
||||||
: (col - boguscols < wp->w_width))) {
|
: (col - boguscols < wp->w_width))) {
|
||||||
@ -3673,7 +3667,8 @@ win_line (
|
|||||||
did_line_attr++;
|
did_line_attr++;
|
||||||
|
|
||||||
// don't do search HL for the rest of the line
|
// don't do search HL for the rest of the line
|
||||||
if (line_attr != 0 && char_attr == search_attr && col > 0) {
|
if ((line_attr_low_priority || line_attr)
|
||||||
|
&& char_attr == search_attr && col > 0) {
|
||||||
char_attr = line_attr;
|
char_attr = line_attr;
|
||||||
}
|
}
|
||||||
if (diff_hlf == HLF_TXD) {
|
if (diff_hlf == HLF_TXD) {
|
||||||
@ -4035,13 +4030,16 @@ win_line (
|
|||||||
if (wp->w_p_cuc && VCOL_HLC == (long)wp->w_virtcol
|
if (wp->w_p_cuc && VCOL_HLC == (long)wp->w_virtcol
|
||||||
&& lnum != wp->w_cursor.lnum) {
|
&& lnum != wp->w_cursor.lnum) {
|
||||||
vcol_save_attr = char_attr;
|
vcol_save_attr = char_attr;
|
||||||
char_attr = hl_combine_attr(char_attr, win_hl_attr(wp, HLF_CUC));
|
char_attr = hl_combine_attr(win_hl_attr(wp, HLF_CUC), char_attr);
|
||||||
} else if (draw_color_col && VCOL_HLC == *color_cols) {
|
} else if (draw_color_col && VCOL_HLC == *color_cols) {
|
||||||
vcol_save_attr = char_attr;
|
vcol_save_attr = char_attr;
|
||||||
char_attr = hl_combine_attr(char_attr, win_hl_attr(wp, HLF_MC));
|
char_attr = hl_combine_attr(win_hl_attr(wp, HLF_MC), char_attr);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Apply `line_attr_low_priority` now, so that everthing can override it.
|
||||||
|
char_attr = hl_combine_attr(line_attr_low_priority, char_attr);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Store character to be displayed.
|
* Store character to be displayed.
|
||||||
* Skip characters that are left of the screen for 'nowrap'.
|
* Skip characters that are left of the screen for 'nowrap'.
|
||||||
|
@ -5567,8 +5567,10 @@ bool syntax_present(win_T *win)
|
|||||||
|
|
||||||
|
|
||||||
static enum {
|
static enum {
|
||||||
EXP_SUBCMD, /* expand ":syn" sub-commands */
|
EXP_SUBCMD, // expand ":syn" sub-commands
|
||||||
EXP_CASE /* expand ":syn case" arguments */
|
EXP_CASE, // expand ":syn case" arguments
|
||||||
|
EXP_SPELL, // expand ":syn spell" arguments
|
||||||
|
EXP_SYNC // expand ":syn sync" arguments
|
||||||
} expand_what;
|
} expand_what;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -5612,6 +5614,10 @@ void set_context_in_syntax_cmd(expand_T *xp, const char *arg)
|
|||||||
xp->xp_context = EXPAND_NOTHING;
|
xp->xp_context = EXPAND_NOTHING;
|
||||||
} else if (STRNICMP(arg, "case", p - arg) == 0) {
|
} else if (STRNICMP(arg, "case", p - arg) == 0) {
|
||||||
expand_what = EXP_CASE;
|
expand_what = EXP_CASE;
|
||||||
|
} else if (STRNICMP(arg, "spell", p - arg) == 0) {
|
||||||
|
expand_what = EXP_SPELL;
|
||||||
|
} else if (STRNICMP(arg, "sync", p - arg) == 0) {
|
||||||
|
expand_what = EXP_SYNC;
|
||||||
} else if (STRNICMP(arg, "keyword", p - arg) == 0
|
} else if (STRNICMP(arg, "keyword", p - arg) == 0
|
||||||
|| STRNICMP(arg, "region", p - arg) == 0
|
|| STRNICMP(arg, "region", p - arg) == 0
|
||||||
|| STRNICMP(arg, "match", p - arg) == 0
|
|| STRNICMP(arg, "match", p - arg) == 0
|
||||||
@ -5624,17 +5630,33 @@ void set_context_in_syntax_cmd(expand_T *xp, const char *arg)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static char *(case_args[]) = {"match", "ignore", NULL};
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Function given to ExpandGeneric() to obtain the list syntax names for
|
* Function given to ExpandGeneric() to obtain the list syntax names for
|
||||||
* expansion.
|
* expansion.
|
||||||
*/
|
*/
|
||||||
char_u *get_syntax_name(expand_T *xp, int idx)
|
char_u *get_syntax_name(expand_T *xp, int idx)
|
||||||
{
|
{
|
||||||
if (expand_what == EXP_SUBCMD)
|
switch (expand_what) {
|
||||||
return (char_u *)subcommands[idx].name;
|
case EXP_SUBCMD:
|
||||||
return (char_u *)case_args[idx];
|
return (char_u *)subcommands[idx].name;
|
||||||
|
case EXP_CASE: {
|
||||||
|
static char *case_args[] = { "match", "ignore", NULL };
|
||||||
|
return (char_u *)case_args[idx];
|
||||||
|
}
|
||||||
|
case EXP_SPELL: {
|
||||||
|
static char *spell_args[] =
|
||||||
|
{ "toplevel", "notoplevel", "default", NULL };
|
||||||
|
return (char_u *)spell_args[idx];
|
||||||
|
}
|
||||||
|
case EXP_SYNC: {
|
||||||
|
static char *sync_args[] =
|
||||||
|
{ "ccomment", "clear", "fromstart",
|
||||||
|
"linebreaks=", "linecont", "lines=", "match",
|
||||||
|
"maxlines=", "minlines=", "region", NULL };
|
||||||
|
return (char_u *)sync_args[idx];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -6825,8 +6847,6 @@ int hl_combine_attr(int char_attr, int prim_attr)
|
|||||||
if (char_aep != NULL) {
|
if (char_aep != NULL) {
|
||||||
// Copy all attributes from char_aep to the new entry
|
// Copy all attributes from char_aep to the new entry
|
||||||
new_en = *char_aep;
|
new_en = *char_aep;
|
||||||
} else {
|
|
||||||
memset(&new_en, 0, sizeof(new_en));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
spell_aep = syn_cterm_attr2entry(prim_attr);
|
spell_aep = syn_cterm_attr2entry(prim_attr);
|
||||||
|
@ -76,3 +76,11 @@ func Test_syntax_after_reload()
|
|||||||
call assert_true(exists('g:gotit'))
|
call assert_true(exists('g:gotit'))
|
||||||
call delete('Xsomefile')
|
call delete('Xsomefile')
|
||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
|
func Test_syntax_completion()
|
||||||
|
call feedkeys(":syn spell \<C-A>\<C-B>\"\<CR>", 'tx')
|
||||||
|
call assert_equal('"syn spell default notoplevel toplevel', @:)
|
||||||
|
|
||||||
|
call feedkeys(":syn sync \<C-A>\<C-B>\"\<CR>", 'tx')
|
||||||
|
call assert_equal('"syn sync ccomment clear fromstart linebreaks= linecont lines= match maxlines= minlines= region', @:)
|
||||||
|
endfunc
|
||||||
|
@ -946,7 +946,7 @@ static const int included_patches[] = {
|
|||||||
// 160,
|
// 160,
|
||||||
159,
|
159,
|
||||||
158,
|
158,
|
||||||
// 157,
|
157,
|
||||||
156,
|
156,
|
||||||
// 155,
|
// 155,
|
||||||
// 154,
|
// 154,
|
||||||
@ -955,13 +955,13 @@ static const int included_patches[] = {
|
|||||||
// 151,
|
// 151,
|
||||||
150,
|
150,
|
||||||
149,
|
149,
|
||||||
// 148,
|
148,
|
||||||
147,
|
147,
|
||||||
146,
|
146,
|
||||||
// 145 NA
|
// 145 NA
|
||||||
// 144 NA
|
// 144 NA
|
||||||
143,
|
143,
|
||||||
// 142,
|
142,
|
||||||
// 141,
|
// 141,
|
||||||
// 140,
|
// 140,
|
||||||
// 139 NA
|
// 139 NA
|
||||||
|
@ -4718,4 +4718,38 @@ describe('cindent', function()
|
|||||||
JSEND
|
JSEND
|
||||||
]=])
|
]=])
|
||||||
end)
|
end)
|
||||||
|
|
||||||
|
it('line continuations in macros / vim-patch 8.0.0148', function()
|
||||||
|
insert_([=[
|
||||||
|
/* start of define */
|
||||||
|
{
|
||||||
|
}
|
||||||
|
#define AAA \
|
||||||
|
BBB\
|
||||||
|
CCC
|
||||||
|
|
||||||
|
#define CNT \
|
||||||
|
1 + \
|
||||||
|
2 + \
|
||||||
|
4
|
||||||
|
/* end of define */]=])
|
||||||
|
|
||||||
|
feed_command('set cino&')
|
||||||
|
feed_command('/start of define')
|
||||||
|
feed('=/end of define<cr>')
|
||||||
|
|
||||||
|
expect([=[
|
||||||
|
/* start of define */
|
||||||
|
{
|
||||||
|
}
|
||||||
|
#define AAA \
|
||||||
|
BBB\
|
||||||
|
CCC
|
||||||
|
|
||||||
|
#define CNT \
|
||||||
|
1 + \
|
||||||
|
2 + \
|
||||||
|
4
|
||||||
|
/* end of define */]=])
|
||||||
|
end)
|
||||||
end)
|
end)
|
||||||
|
@ -518,7 +518,7 @@ describe("'listchars' highlight", function()
|
|||||||
]])
|
]])
|
||||||
feed_command('set cursorline')
|
feed_command('set cursorline')
|
||||||
screen:expect([[
|
screen:expect([[
|
||||||
{2:^>-------.}{1:abcd}{2:.}{1:Lorem}{4:>}|
|
{2:^>-------.}{1:abcd}{2:.}{1:Lorem}{3:>}|
|
||||||
{5:>-------.}abcd{5:*}{4:¬} |
|
{5:>-------.}abcd{5:*}{4:¬} |
|
||||||
{4:¬} |
|
{4:¬} |
|
||||||
{4:~ }|
|
{4:~ }|
|
||||||
@ -526,7 +526,7 @@ describe("'listchars' highlight", function()
|
|||||||
]])
|
]])
|
||||||
feed('$')
|
feed('$')
|
||||||
screen:expect([[
|
screen:expect([[
|
||||||
{4:<}{1:r}{2:.}{1:sit}{2:.}{1:ame^t}{3:¬}{1: }|
|
{3:<}{1:r}{2:.}{1:sit}{2:.}{1:ame^t}{3:¬}{1: }|
|
||||||
{4:<} |
|
{4:<} |
|
||||||
{4:<} |
|
{4:<} |
|
||||||
{4:~ }|
|
{4:~ }|
|
||||||
@ -607,7 +607,7 @@ describe("'listchars' highlight", function()
|
|||||||
feed('<esc>$')
|
feed('<esc>$')
|
||||||
screen:expect([[
|
screen:expect([[
|
||||||
{4:<} |
|
{4:<} |
|
||||||
{4:<}{1:r}{2:.}{1:sit}{2:.}{1:ame^t}{3:¬}{1: }|
|
{3:<}{1:r}{2:.}{1:sit}{2:.}{1:ame^t}{3:¬}{1: }|
|
||||||
{4:<} |
|
{4:<} |
|
||||||
{4:~ }|
|
{4:~ }|
|
||||||
|
|
|
|
||||||
|
Loading…
Reference in New Issue
Block a user