Mercurial > vim
comparison src/screen.c @ 11890:318ae82d8ba4 v8.0.0825
patch 8.0.0825: not easy to see that a window is a terminal window
commit https://github.com/vim/vim/commit/3633cf5201e914cc802fd2f813fa87bc959ffaec
Author: Bram Moolenaar <Bram@vim.org>
Date: Mon Jul 31 22:29:35 2017 +0200
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.
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Mon, 31 Jul 2017 22:30:04 +0200 |
parents | be40c8a9240d |
children | 594d96ac226b |
comparison
equal
deleted
inserted
replaced
11889:0af9c5c882d3 | 11890:318ae82d8ba4 |
---|---|
163 static void recording_mode(int attr); | 163 static void recording_mode(int attr); |
164 #if defined(FEAT_WINDOWS) | 164 #if defined(FEAT_WINDOWS) |
165 static void draw_tabline(void); | 165 static void draw_tabline(void); |
166 #endif | 166 #endif |
167 #if defined(FEAT_WINDOWS) || defined(FEAT_WILDMENU) || defined(FEAT_STL_OPT) | 167 #if defined(FEAT_WINDOWS) || defined(FEAT_WILDMENU) || defined(FEAT_STL_OPT) |
168 static int fillchar_status(int *attr, int is_curwin); | 168 static int fillchar_status(int *attr, win_T *wp); |
169 #endif | 169 #endif |
170 #ifdef FEAT_WINDOWS | 170 #ifdef FEAT_WINDOWS |
171 static int fillchar_vsep(int *attr); | 171 static int fillchar_vsep(int *attr); |
172 #endif | 172 #endif |
173 #ifdef FEAT_STL_OPT | 173 #ifdef FEAT_STL_OPT |
6684 if ((long)clen >= Columns) | 6684 if ((long)clen >= Columns) |
6685 break; | 6685 break; |
6686 --first_match; | 6686 --first_match; |
6687 } | 6687 } |
6688 | 6688 |
6689 fillchar = fillchar_status(&attr, TRUE); | 6689 fillchar = fillchar_status(&attr, curwin); |
6690 | 6690 |
6691 if (first_match == 0) | 6691 if (first_match == 0) |
6692 { | 6692 { |
6693 *buf = NUL; | 6693 *buf = NUL; |
6694 len = 0; | 6694 len = 0; |
6863 redraw_custom_statusline(wp); | 6863 redraw_custom_statusline(wp); |
6864 } | 6864 } |
6865 #endif | 6865 #endif |
6866 else | 6866 else |
6867 { | 6867 { |
6868 fillchar = fillchar_status(&attr, wp == curwin); | 6868 fillchar = fillchar_status(&attr, wp); |
6869 | 6869 |
6870 get_trans_bufname(wp->w_buffer); | 6870 get_trans_bufname(wp->w_buffer); |
6871 p = NameBuff; | 6871 p = NameBuff; |
6872 len = (int)STRLEN(p); | 6872 len = (int)STRLEN(p); |
6873 | 6873 |
6960 * May need to draw the character below the vertical separator. | 6960 * May need to draw the character below the vertical separator. |
6961 */ | 6961 */ |
6962 if (wp->w_vsep_width != 0 && wp->w_status_height != 0 && redrawing()) | 6962 if (wp->w_vsep_width != 0 && wp->w_status_height != 0 && redrawing()) |
6963 { | 6963 { |
6964 if (stl_connected(wp)) | 6964 if (stl_connected(wp)) |
6965 fillchar = fillchar_status(&attr, wp == curwin); | 6965 fillchar = fillchar_status(&attr, wp); |
6966 else | 6966 else |
6967 fillchar = fillchar_vsep(&attr); | 6967 fillchar = fillchar_vsep(&attr); |
6968 screen_putchar(fillchar, W_WINROW(wp) + wp->w_height, W_ENDCOL(wp), | 6968 screen_putchar(fillchar, W_WINROW(wp) + wp->w_height, W_ENDCOL(wp), |
6969 attr); | 6969 attr); |
6970 } | 6970 } |
7134 # endif | 7134 # endif |
7135 } | 7135 } |
7136 else | 7136 else |
7137 { | 7137 { |
7138 row = W_WINROW(wp) + wp->w_height; | 7138 row = W_WINROW(wp) + wp->w_height; |
7139 fillchar = fillchar_status(&attr, wp == curwin); | 7139 fillchar = fillchar_status(&attr, wp); |
7140 maxwidth = W_WIDTH(wp); | 7140 maxwidth = W_WIDTH(wp); |
7141 | 7141 |
7142 if (draw_ruler) | 7142 if (draw_ruler) |
7143 { | 7143 { |
7144 stl = p_ruf; | 7144 stl = p_ruf; |
10703 #if defined(FEAT_WINDOWS) || defined(FEAT_WILDMENU) || defined(FEAT_STL_OPT) | 10703 #if defined(FEAT_WINDOWS) || defined(FEAT_WILDMENU) || defined(FEAT_STL_OPT) |
10704 /* | 10704 /* |
10705 * Get the character to use in a status line. Get its attributes in "*attr". | 10705 * Get the character to use in a status line. Get its attributes in "*attr". |
10706 */ | 10706 */ |
10707 static int | 10707 static int |
10708 fillchar_status(int *attr, int is_curwin) | 10708 fillchar_status(int *attr, win_T *wp) |
10709 { | 10709 { |
10710 int fill; | 10710 int fill; |
10711 if (is_curwin) | 10711 |
10712 #ifdef FEAT_TERMINAL | |
10713 if (bt_terminal(wp->w_buffer)) | |
10714 { | |
10715 *attr = HL_ATTR(HLF_ST); | |
10716 if (wp == curwin) | |
10717 fill = fill_stl; | |
10718 else | |
10719 fill = fill_stlnc; | |
10720 } | |
10721 else | |
10722 #endif | |
10723 if (wp == curwin) | |
10712 { | 10724 { |
10713 *attr = HL_ATTR(HLF_S); | 10725 *attr = HL_ATTR(HLF_S); |
10714 fill = fill_stl; | 10726 fill = fill_stl; |
10715 } | 10727 } |
10716 else | 10728 else |
10720 } | 10732 } |
10721 /* Use fill when there is highlighting, and highlighting of current | 10733 /* Use fill when there is highlighting, and highlighting of current |
10722 * window differs, or the fillchars differ, or this is not the | 10734 * window differs, or the fillchars differ, or this is not the |
10723 * current window */ | 10735 * current window */ |
10724 if (*attr != 0 && ((HL_ATTR(HLF_S) != HL_ATTR(HLF_SNC) | 10736 if (*attr != 0 && ((HL_ATTR(HLF_S) != HL_ATTR(HLF_SNC) |
10725 || !is_curwin || ONE_WINDOW) | 10737 || wp != curwin || ONE_WINDOW) |
10726 || (fill_stl != fill_stlnc))) | 10738 || (fill_stl != fill_stlnc))) |
10727 return fill; | 10739 return fill; |
10728 if (is_curwin) | 10740 if (wp == curwin) |
10729 return '^'; | 10741 return '^'; |
10730 return '='; | 10742 return '='; |
10731 } | 10743 } |
10732 #endif | 10744 #endif |
10733 | 10745 |
10911 cursor_off(); | 10923 cursor_off(); |
10912 #ifdef FEAT_WINDOWS | 10924 #ifdef FEAT_WINDOWS |
10913 if (wp->w_status_height) | 10925 if (wp->w_status_height) |
10914 { | 10926 { |
10915 row = W_WINROW(wp) + wp->w_height; | 10927 row = W_WINROW(wp) + wp->w_height; |
10916 fillchar = fillchar_status(&attr, wp == curwin); | 10928 fillchar = fillchar_status(&attr, wp); |
10917 off = W_WINCOL(wp); | 10929 off = W_WINCOL(wp); |
10918 width = W_WIDTH(wp); | 10930 width = W_WIDTH(wp); |
10919 } | 10931 } |
10920 else | 10932 else |
10921 #endif | 10933 #endif |