Permalink
Browse files

patch 8.0.0825: not easy to see that a window is a terminal window

Problem:    Not easy to see that a window is a terminal window.
Solution:   Add StatusLineTerm highlighting.
  • Loading branch information...
brammool committed Jul 31, 2017
1 parent 392d1bf commit 3633cf5201e914cc802fd2f813fa87bc959ffaec
Showing with 35 additions and 15 deletions.
  1. +3 −2 src/option.c
  2. +22 −10 src/screen.c
  3. +4 −0 src/syntax.c
  4. +2 −0 src/version.c
  5. +4 −3 src/vim.h
View
@@ -479,8 +479,9 @@ struct vimoption
#if defined(FEAT_DIFF) || defined(FEAT_FOLDING) || defined(FEAT_SPELL) \
|| defined(FEAT_WINDOWS) || defined(FEAT_CLIPBOARD) \
|| defined(FEAT_INS_EXPAND) || defined(FEAT_SYN_HL) \
|| defined(FEAT_CONCEAL) || defined(FEAT_QUICKFIX)
# define HIGHLIGHT_INIT "8:SpecialKey,~:EndOfBuffer,@:NonText,d:Directory,e:ErrorMsg,i:IncSearch,l:Search,m:MoreMsg,M:ModeMsg,n:LineNr,N:CursorLineNr,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,x:PmenuSbar,X:PmenuThumb,*:TabLine,#:TabLineSel,_:TabLineFill,!:CursorColumn,.:CursorLine,o:ColorColumn,q:QuickFixLine"
|| defined(FEAT_CONCEAL) || defined(FEAT_QUICKFIX) \
|| defined(FEAT_TERMINAL)
# define HIGHLIGHT_INIT "8:SpecialKey,~:EndOfBuffer,@:NonText,d:Directory,e:ErrorMsg,i:IncSearch,l:Search,m:MoreMsg,M:ModeMsg,n:LineNr,N:CursorLineNr,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,x:PmenuSbar,X:PmenuThumb,*:TabLine,#:TabLineSel,_:TabLineFill,!:CursorColumn,.:CursorLine,o:ColorColumn,q:QuickFixLine,$:StatusLineTerm"
#else
# define HIGHLIGHT_INIT "8:SpecialKey,@:NonText,d:Directory,e:ErrorMsg,i:IncSearch,l:Search,m:MoreMsg,M:ModeMsg,n:LineNr,N:CursorLineNr,r:Question,s:StatusLine,S:StatusLineNC,t:Title,v:Visual,w:WarningMsg,W:WildMenu,>:SignColumn,*:TabLine,#:TabLineSel,_:TabLineFill"
#endif
View
@@ -165,7 +165,7 @@ static void recording_mode(int attr);
static void draw_tabline(void);
#endif
#if defined(FEAT_WINDOWS) || defined(FEAT_WILDMENU) || defined(FEAT_STL_OPT)
static int fillchar_status(int *attr, int is_curwin);
static int fillchar_status(int *attr, win_T *wp);
#endif
#ifdef FEAT_WINDOWS
static int fillchar_vsep(int *attr);
@@ -6686,7 +6686,7 @@ win_redr_status_matches(
--first_match;
}
fillchar = fillchar_status(&attr, TRUE);
fillchar = fillchar_status(&attr, curwin);
if (first_match == 0)
{
@@ -6865,7 +6865,7 @@ win_redr_status(win_T *wp)
#endif
else
{
fillchar = fillchar_status(&attr, wp == curwin);
fillchar = fillchar_status(&attr, wp);
get_trans_bufname(wp->w_buffer);
p = NameBuff;
@@ -6962,7 +6962,7 @@ win_redr_status(win_T *wp)
if (wp->w_vsep_width != 0 && wp->w_status_height != 0 && redrawing())
{
if (stl_connected(wp))
fillchar = fillchar_status(&attr, wp == curwin);
fillchar = fillchar_status(&attr, wp);
else
fillchar = fillchar_vsep(&attr);
screen_putchar(fillchar, W_WINROW(wp) + wp->w_height, W_ENDCOL(wp),
@@ -7136,7 +7136,7 @@ win_redr_custom(
else
{
row = W_WINROW(wp) + wp->w_height;
fillchar = fillchar_status(&attr, wp == curwin);
fillchar = fillchar_status(&attr, wp);
maxwidth = W_WIDTH(wp);
if (draw_ruler)
@@ -10705,10 +10705,22 @@ get_trans_bufname(buf_T *buf)
* Get the character to use in a status line. Get its attributes in "*attr".
*/
static int
fillchar_status(int *attr, int is_curwin)
fillchar_status(int *attr, win_T *wp)
{
int fill;
if (is_curwin)
#ifdef FEAT_TERMINAL
if (bt_terminal(wp->w_buffer))
{
*attr = HL_ATTR(HLF_ST);
if (wp == curwin)
fill = fill_stl;
else
fill = fill_stlnc;
}
else
#endif
if (wp == curwin)
{
*attr = HL_ATTR(HLF_S);
fill = fill_stl;
@@ -10722,10 +10734,10 @@ fillchar_status(int *attr, int is_curwin)
* window differs, or the fillchars differ, or this is not the
* current window */
if (*attr != 0 && ((HL_ATTR(HLF_S) != HL_ATTR(HLF_SNC)
|| !is_curwin || ONE_WINDOW)
|| wp != curwin || ONE_WINDOW)
|| (fill_stl != fill_stlnc)))
return fill;
if (is_curwin)
if (wp == curwin)
return '^';
return '=';
}
@@ -10913,7 +10925,7 @@ win_redr_ruler(win_T *wp, int always)
if (wp->w_status_height)
{
row = W_WINROW(wp) + wp->w_height;
fillchar = fillchar_status(&attr, wp == curwin);
fillchar = fillchar_status(&attr, wp);
off = W_WINCOL(wp);
width = W_WIDTH(wp);
}
View
@@ -6887,6 +6887,10 @@ static char *(highlight_init_both[]) =
"StatusLine term=reverse,bold cterm=reverse,bold gui=reverse,bold"),
CENT("StatusLineNC term=reverse cterm=reverse",
"StatusLineNC term=reverse cterm=reverse gui=reverse"),
#ifdef FEAT_TERMINAL
CENT("StatusLineTerm term=reverse cterm=reverse ctermFg=DarkGreen",
"StatusLineTerm term=reverse cterm=reverse ctermFg=DarkGreen gui=reverse guifg=DarkGreen"),
#endif
"default link EndOfBuffer NonText",
#ifdef FEAT_WINDOWS
CENT("VertSplit term=reverse cterm=reverse",
View
@@ -769,6 +769,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
825,
/**/
824,
/**/
View
@@ -1430,10 +1430,11 @@ typedef enum
, HLF_TP /* tabpage line */
, HLF_TPS /* tabpage line selected */
, HLF_TPF /* tabpage line filler */
, HLF_CUC /* 'cursurcolumn' */
, HLF_CUL /* 'cursurline' */
, HLF_CUC /* 'cursorcolumn' */
, HLF_CUL /* 'cursorline' */
, HLF_MC /* 'colorcolumn' */
, HLF_QFL /* quickfix window line currently selected */
, HLF_ST /* status lines of terminal windows */
, HLF_COUNT /* MUST be the last one */
} hlf_T;
@@ -1443,7 +1444,7 @@ typedef enum
'n', 'N', 'r', 's', 'S', 'c', 't', 'v', 'V', 'w', 'W', \
'f', 'F', 'A', 'C', 'D', 'T', '-', '>', \
'B', 'P', 'R', 'L', \
'+', '=', 'x', 'X', '*', '#', '_', '!', '.', 'o', 'q'}
'+', '=', 'x', 'X', '*', '#', '_', '!', '.', 'o', 'q', '$'}
/*
* Boolean constants

0 comments on commit 3633cf5

Please sign in to comment.