]> granicus.if.org Git - vim/commitdiff
patch 8.0.0825: not easy to see that a window is a terminal window v8.0.0825
authorBram Moolenaar <Bram@vim.org>
Mon, 31 Jul 2017 20:29:35 +0000 (22:29 +0200)
committerBram Moolenaar <Bram@vim.org>
Mon, 31 Jul 2017 20:29:35 +0000 (22:29 +0200)
Problem:    Not easy to see that a window is a terminal window.
Solution:   Add StatusLineTerm highlighting.

src/option.c
src/screen.c
src/syntax.c
src/version.c
src/vim.h

index 6e4d1a5df67e56e43f35fefd471e1cb706d9073a..23474617c02c2730969d4b9374d0199534b98b42 100644 (file)
@@ -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
index baedea755b64a99f8234001a5b41c0097c551d97..ea07d02d422e3371bc77ac14e07ab1f38275c5cb 100644 (file)
@@ -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);
        }
index 98c3f51020e9694ad38875d76cc44a27446d4d3c..e026c440031263ec2614da3cdd0dbe09b2d181a8 100644 (file)
@@ -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",
index 5a3c1647de6b687b50471ea46dd8a6268ff55d01..b2dfaa343e2a6b658a353439f500a650292183fe 100644 (file)
@@ -769,6 +769,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    825,
 /**/
     824,
 /**/
index 243f8a244b4c334a94e8e92a9d06811653912cda..8b6337e23235ce410b8b35facf3b48540214127f 100644 (file)
--- a/src/vim.h
+++ b/src/vim.h
@@ -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