mirror of
https://github.com/vim/vim.git
synced 2025-09-28 04:24:06 -04:00
patch 9.1.0277: Cannot highlight the Command-line
Problem: Cannot highlight the Command-line Solution: Add the MsgArea highlighting group (Shougo Matsushita) closes: #14327 Signed-off-by: Shougo Matsushita <Shougo.Matsu@gmail.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
This commit is contained in:
committed by
Christian Brabandt
parent
7005b7ee7f
commit
be2b03c6ee
@@ -2485,7 +2485,7 @@ To specify elements that should not be concealed, set the following variable: >
|
|||||||
|
|
||||||
This is a list of the rules wich can be used here:
|
This is a list of the rules wich can be used here:
|
||||||
|
|
||||||
- titleblock
|
- titleblock
|
||||||
- image
|
- image
|
||||||
- block
|
- block
|
||||||
- subscript
|
- subscript
|
||||||
@@ -5585,6 +5585,9 @@ MessageWindow Messages popup window used by `:echowindow`. If not defined
|
|||||||
|hl-WarningMsg| is used.
|
|hl-WarningMsg| is used.
|
||||||
*hl-ModeMsg*
|
*hl-ModeMsg*
|
||||||
ModeMsg 'showmode' message (e.g., "-- INSERT --").
|
ModeMsg 'showmode' message (e.g., "-- INSERT --").
|
||||||
|
*hl-MsgArea*
|
||||||
|
MsgArea Command-line area, also used for outputting messages, see also
|
||||||
|
'cmdheight'
|
||||||
*hl-MoreMsg*
|
*hl-MoreMsg*
|
||||||
MoreMsg |more-prompt|
|
MoreMsg |more-prompt|
|
||||||
*hl-NonText*
|
*hl-NonText*
|
||||||
|
@@ -8050,6 +8050,7 @@ hl-Menu syntax.txt /*hl-Menu*
|
|||||||
hl-MessageWindow syntax.txt /*hl-MessageWindow*
|
hl-MessageWindow syntax.txt /*hl-MessageWindow*
|
||||||
hl-ModeMsg syntax.txt /*hl-ModeMsg*
|
hl-ModeMsg syntax.txt /*hl-ModeMsg*
|
||||||
hl-MoreMsg syntax.txt /*hl-MoreMsg*
|
hl-MoreMsg syntax.txt /*hl-MoreMsg*
|
||||||
|
hl-MsgArea syntax.txt /*hl-MsgArea*
|
||||||
hl-NonText syntax.txt /*hl-NonText*
|
hl-NonText syntax.txt /*hl-NonText*
|
||||||
hl-Normal syntax.txt /*hl-Normal*
|
hl-Normal syntax.txt /*hl-Normal*
|
||||||
hl-Pmenu syntax.txt /*hl-Pmenu*
|
hl-Pmenu syntax.txt /*hl-Pmenu*
|
||||||
|
@@ -1,4 +1,4 @@
|
|||||||
*version9.txt* For Vim version 9.1. Last change: 2024 Mar 28
|
*version9.txt* For Vim version 9.1. Last change: 2024 Apr 08
|
||||||
|
|
||||||
|
|
||||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||||
@@ -41581,6 +41581,10 @@ Autocommands: ~
|
|||||||
|WinNewPre| before creating a new window
|
|WinNewPre| before creating a new window
|
||||||
|
|
||||||
|
|
||||||
|
Highlighting: ~
|
||||||
|
|
||||||
|
|hl-MsgArea| highlighting of the Command-line and messages area.
|
||||||
|
|
||||||
Commands: ~
|
Commands: ~
|
||||||
|
|
||||||
|
|
||||||
|
@@ -1637,6 +1637,9 @@ msg_outtrans_len_attr(char_u *msgstr, int len, int attr)
|
|||||||
// Only quit when got_int was set in here.
|
// Only quit when got_int was set in here.
|
||||||
got_int = FALSE;
|
got_int = FALSE;
|
||||||
|
|
||||||
|
if (attr == 0)
|
||||||
|
attr = HL_ATTR(HLF_MSG);
|
||||||
|
|
||||||
// if MSG_HIST flag set, add message to history
|
// if MSG_HIST flag set, add message to history
|
||||||
if (attr & MSG_HIST)
|
if (attr & MSG_HIST)
|
||||||
{
|
{
|
||||||
@@ -2230,6 +2233,9 @@ msg_puts_attr_len(char *str, int maxlen, int attr)
|
|||||||
if (msg_silent != 0)
|
if (msg_silent != 0)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
if (attr == 0)
|
||||||
|
attr = HL_ATTR(HLF_MSG);
|
||||||
|
|
||||||
// if MSG_HIST flag set, add message to history
|
// if MSG_HIST flag set, add message to history
|
||||||
if ((attr & MSG_HIST) && maxlen < 0)
|
if ((attr & MSG_HIST) && maxlen < 0)
|
||||||
{
|
{
|
||||||
@@ -2678,13 +2684,15 @@ msg_scroll_up(void)
|
|||||||
// Scrolling up doesn't result in the right background. Set the
|
// Scrolling up doesn't result in the right background. Set the
|
||||||
// background here. It's not efficient, but avoids that we have to do
|
// background here. It's not efficient, but avoids that we have to do
|
||||||
// it all over the code.
|
// it all over the code.
|
||||||
screen_fill((int)Rows - 1, (int)Rows, 0, (int)Columns, ' ', ' ', 0);
|
screen_fill((int)Rows - 1, (int)Rows, 0, (int)Columns,
|
||||||
|
' ', ' ', HL_ATTR(HLF_MSG));
|
||||||
|
|
||||||
// Also clear the last char of the last but one line if it was not
|
// Also clear the last char of the last but one line if it was not
|
||||||
// cleared before to avoid a scroll-up.
|
// cleared before to avoid a scroll-up.
|
||||||
if (ScreenAttrs[LineOffset[Rows - 2] + Columns - 1] == (sattr_T)-1)
|
if (ScreenAttrs[LineOffset[Rows - 2] + Columns - 1] == (sattr_T)-1)
|
||||||
screen_fill((int)Rows - 2, (int)Rows - 1,
|
screen_fill((int)Rows - 2, (int)Rows - 1,
|
||||||
(int)Columns - 1, (int)Columns, ' ', ' ', 0);
|
(int)Columns - 1, (int)Columns,
|
||||||
|
' ', ' ', HL_ATTR(HLF_MSG));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2963,7 +2971,8 @@ disp_sb_line(int row, msgchunk_T *smp, int clear_to_eol)
|
|||||||
// If clearing the screen did not work (e.g. because of a background
|
// If clearing the screen did not work (e.g. because of a background
|
||||||
// color and t_ut isn't set) clear until the last column here.
|
// color and t_ut isn't set) clear until the last column here.
|
||||||
if (clear_to_eol)
|
if (clear_to_eol)
|
||||||
screen_fill(row, row + 1, msg_col, (int)Columns, ' ', ' ', 0);
|
screen_fill(row, row + 1, msg_col, (int)Columns,
|
||||||
|
' ', ' ', HL_ATTR(HLF_MSG));
|
||||||
|
|
||||||
if (mp->sb_eol || mp->sb_next == NULL)
|
if (mp->sb_eol || mp->sb_next == NULL)
|
||||||
break;
|
break;
|
||||||
@@ -3131,6 +3140,9 @@ do_more_prompt(int typed_char)
|
|||||||
msgchunk_T *mp_last = NULL;
|
msgchunk_T *mp_last = NULL;
|
||||||
msgchunk_T *mp;
|
msgchunk_T *mp;
|
||||||
int i;
|
int i;
|
||||||
|
int msg_attr;
|
||||||
|
|
||||||
|
msg_attr = HL_ATTR(HLF_MSG);
|
||||||
|
|
||||||
// We get called recursively when a timer callback outputs a message. In
|
// We get called recursively when a timer callback outputs a message. In
|
||||||
// that case don't show another prompt. Also when at the hit-Enter prompt
|
// that case don't show another prompt. Also when at the hit-Enter prompt
|
||||||
@@ -3340,8 +3352,8 @@ do_more_prompt(int typed_char)
|
|||||||
// scroll up, display line at bottom
|
// scroll up, display line at bottom
|
||||||
msg_scroll_up();
|
msg_scroll_up();
|
||||||
inc_msg_scrolled();
|
inc_msg_scrolled();
|
||||||
screen_fill((int)Rows - 2, (int)Rows - 1, 0,
|
screen_fill((int)Rows - 2, (int)Rows - 1, 0, (int)Columns,
|
||||||
(int)Columns, ' ', ' ', 0);
|
' ', ' ', msg_attr);
|
||||||
mp_last = disp_sb_line((int)Rows - 2, mp_last, FALSE);
|
mp_last = disp_sb_line((int)Rows - 2, mp_last, FALSE);
|
||||||
--toscroll;
|
--toscroll;
|
||||||
}
|
}
|
||||||
@@ -3350,8 +3362,8 @@ do_more_prompt(int typed_char)
|
|||||||
if (toscroll <= 0)
|
if (toscroll <= 0)
|
||||||
{
|
{
|
||||||
// displayed the requested text, more prompt again
|
// displayed the requested text, more prompt again
|
||||||
screen_fill((int)Rows - 1, (int)Rows, 0,
|
screen_fill((int)Rows - 1, (int)Rows, 0, (int)Columns,
|
||||||
(int)Columns, ' ', ' ', 0);
|
' ', ' ', msg_attr);
|
||||||
msg_moremsg(FALSE);
|
msg_moremsg(FALSE);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
@@ -3364,7 +3376,7 @@ do_more_prompt(int typed_char)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// clear the --more-- message
|
// clear the --more-- message
|
||||||
screen_fill((int)Rows - 1, (int)Rows, 0, (int)Columns, ' ', ' ', 0);
|
screen_fill((int)Rows - 1, (int)Rows, 0, (int)Columns, ' ', ' ', msg_attr);
|
||||||
State = oldState;
|
State = oldState;
|
||||||
setmouse();
|
setmouse();
|
||||||
if (quit_more)
|
if (quit_more)
|
||||||
@@ -3710,18 +3722,25 @@ msg_clr_eos_force(void)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
int msg_attr;
|
||||||
|
|
||||||
|
msg_attr = HL_ATTR(HLF_MSG);
|
||||||
|
|
||||||
#ifdef FEAT_RIGHTLEFT
|
#ifdef FEAT_RIGHTLEFT
|
||||||
if (cmdmsg_rl)
|
if (cmdmsg_rl)
|
||||||
{
|
{
|
||||||
screen_fill(msg_row, msg_row + 1, 0, msg_col + 1, ' ', ' ', 0);
|
screen_fill(msg_row, msg_row + 1, 0, msg_col + 1,
|
||||||
screen_fill(msg_row + 1, (int)Rows, 0, (int)Columns, ' ', ' ', 0);
|
' ', ' ', msg_attr);
|
||||||
|
screen_fill(msg_row + 1, (int)Rows, 0, (int)Columns,
|
||||||
|
' ', ' ', msg_attr);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
screen_fill(msg_row, msg_row + 1, msg_col, (int)Columns,
|
screen_fill(msg_row, msg_row + 1, msg_col, (int)Columns,
|
||||||
' ', ' ', 0);
|
' ', ' ', msg_attr);
|
||||||
screen_fill(msg_row + 1, (int)Rows, 0, (int)Columns, ' ', ' ', 0);
|
screen_fill(msg_row + 1, (int)Rows, 0, (int)Columns,
|
||||||
|
' ', ' ', msg_attr);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -300,7 +300,7 @@ struct vimoption
|
|||||||
# define ISP_LATIN1 (char_u *)"@,161-255"
|
# define ISP_LATIN1 (char_u *)"@,161-255"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
# define HIGHLIGHT_INIT "8:SpecialKey,~:EndOfBuffer,@:NonText,d:Directory,e:ErrorMsg,i:IncSearch,l:Search,y:CurSearch,m:MoreMsg,M:ModeMsg,n:LineNr,a:LineNrAbove,b:LineNrBelow,N:CursorLineNr,G:CursorLineSign,O:CursorLineFold,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,-:Conceal,B:SpellBad,P:SpellCap,R:SpellRare,L:SpellLocal,+:Pmenu,=:PmenuSel,[:PmenuKind,]:PmenuKindSel,{:PmenuExtra,}:PmenuExtraSel,x:PmenuSbar,X:PmenuThumb,*:TabLine,#:TabLineSel,_:TabLineFill,!:CursorColumn,.:CursorLine,o:ColorColumn,q:QuickFixLine,z:StatusLineTerm,Z:StatusLineTermNC"
|
# define HIGHLIGHT_INIT "8:SpecialKey,~:EndOfBuffer,@:NonText,d:Directory,e:ErrorMsg,i:IncSearch,l:Search,y:CurSearch,m:MoreMsg,M:ModeMsg,n:LineNr,a:LineNrAbove,b:LineNrBelow,N:CursorLineNr,G:CursorLineSign,O:CursorLineFold,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,-:Conceal,B:SpellBad,P:SpellCap,R:SpellRare,L:SpellLocal,+:Pmenu,=:PmenuSel,[:PmenuKind,]:PmenuKindSel,{:PmenuExtra,}:PmenuExtraSel,x:PmenuSbar,X:PmenuThumb,*:TabLine,#:TabLineSel,_:TabLineFill,!:CursorColumn,.:CursorLine,o:ColorColumn,q:QuickFixLine,z:StatusLineTerm,Z:StatusLineTermNC,g:MsgArea"
|
||||||
|
|
||||||
// Default python version for pyx* commands
|
// Default python version for pyx* commands
|
||||||
#if defined(FEAT_PYTHON) && defined(FEAT_PYTHON3)
|
#if defined(FEAT_PYTHON) && defined(FEAT_PYTHON3)
|
||||||
|
@@ -856,6 +856,15 @@ func Test_highlight_User()
|
|||||||
hi clear
|
hi clear
|
||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
|
" Test for MsgArea highlighting
|
||||||
|
func Test_highlight_MsgArea()
|
||||||
|
CheckNotGui
|
||||||
|
hi MsgArea ctermfg=20
|
||||||
|
redraw!
|
||||||
|
call assert_equal('20', synIDattr(synIDtrans(hlID('MsgArea')), 'fg'))
|
||||||
|
hi clear
|
||||||
|
endfunc
|
||||||
|
|
||||||
" Test for using RGB color values in a highlight group
|
" Test for using RGB color values in a highlight group
|
||||||
func Test_xxlast_highlight_RGB_color()
|
func Test_xxlast_highlight_RGB_color()
|
||||||
CheckCanRunGui
|
CheckCanRunGui
|
||||||
|
@@ -704,6 +704,8 @@ static char *(features[]) =
|
|||||||
|
|
||||||
static int included_patches[] =
|
static int included_patches[] =
|
||||||
{ /* Add new patch number below this line */
|
{ /* Add new patch number below this line */
|
||||||
|
/**/
|
||||||
|
277,
|
||||||
/**/
|
/**/
|
||||||
276,
|
276,
|
||||||
/**/
|
/**/
|
||||||
|
@@ -1515,6 +1515,7 @@ typedef enum
|
|||||||
, HLF_QFL // quickfix window line currently selected
|
, HLF_QFL // quickfix window line currently selected
|
||||||
, HLF_ST // status lines of terminal windows
|
, HLF_ST // status lines of terminal windows
|
||||||
, HLF_STNC // status lines of not-current terminal windows
|
, HLF_STNC // status lines of not-current terminal windows
|
||||||
|
, HLF_MSG // message area
|
||||||
, HLF_COUNT // MUST be the last one
|
, HLF_COUNT // MUST be the last one
|
||||||
} hlf_T;
|
} hlf_T;
|
||||||
|
|
||||||
@@ -1526,7 +1527,7 @@ typedef enum
|
|||||||
'B', 'P', 'R', 'L', \
|
'B', 'P', 'R', 'L', \
|
||||||
'+', '=', '[', ']', '{', '}', 'x', 'X', \
|
'+', '=', '[', ']', '{', '}', 'x', 'X', \
|
||||||
'*', '#', '_', '!', '.', 'o', 'q', \
|
'*', '#', '_', '!', '.', 'o', 'q', \
|
||||||
'z', 'Z'}
|
'z', 'Z', 'g'}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Boolean constants
|
* Boolean constants
|
||||||
|
Reference in New Issue
Block a user