diff options
author | Bram Moolenaar <Bram@vim.org> | 2017-07-31 22:29:35 +0200 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2017-07-31 22:29:35 +0200 |
commit | 3633cf5201e914cc802fd2f813fa87bc959ffaec (patch) | |
tree | 6fbded0f374d7a61fc9107002b90af10e8f27a08 | |
parent | 392d1bfa5e14b9534af322003723ebd57cedcc64 (diff) | |
download | vim-git-3633cf5201e914cc802fd2f813fa87bc959ffaec.tar.gz |
patch 8.0.0825: not easy to see that a window is a terminal windowv8.0.0825
Problem: Not easy to see that a window is a terminal window.
Solution: Add StatusLineTerm highlighting.
-rw-r--r-- | src/option.c | 5 | ||||
-rw-r--r-- | src/screen.c | 32 | ||||
-rw-r--r-- | src/syntax.c | 4 | ||||
-rw-r--r-- | src/version.c | 2 | ||||
-rw-r--r-- | src/vim.h | 7 |
5 files changed, 35 insertions, 15 deletions
diff --git a/src/option.c b/src/option.c index 6e4d1a5df..23474617c 100644 --- a/src/option.c +++ b/src/option.c @@ -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 diff --git a/src/screen.c b/src/screen.c index baedea755..ea07d02d4 100644 --- a/src/screen.c +++ b/src/screen.c @@ -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); } diff --git a/src/syntax.c b/src/syntax.c index 98c3f5102..e026c4400 100644 --- a/src/syntax.c +++ b/src/syntax.c @@ -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", diff --git a/src/version.c b/src/version.c index 5a3c1647d..b2dfaa343 100644 --- a/src/version.c +++ b/src/version.c @@ -770,6 +770,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ /**/ + 825, +/**/ 824, /**/ 823, @@ -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 |