diff src/screen.c @ 12433:735b49ff8fbb v8.0.1096

patch 8.0.1096: terminal window in Normal mode has wrong background commit https://github.com/vim/vim/commit/238d43b32859d1b4e6b7072d552289a748cbfee1 Author: Bram Moolenaar <Bram@vim.org> Date: Mon Sep 11 22:00:51 2017 +0200 patch 8.0.1096: terminal window in Normal mode has wrong background Problem: Terminal window in Normal mode has wrong background. Solution: Store the default background and use it for clearning until the end of the line. Not for below the last line, since there is no text there.
author Christian Brabandt <cb@256bit.org>
date Mon, 11 Sep 2017 22:15:04 +0200
parents 4dba3e4f3b01
children 40961647f547
line wrap: on
line diff
--- a/src/screen.c
+++ b/src/screen.c
@@ -3139,6 +3139,7 @@ win_line(
 #endif
 #ifdef FEAT_TERMINAL
     int		get_term_attr = FALSE;
+    int		term_attr = 0;		/* background for terminal window */
 #endif
 
     /* draw_state: items that are drawn in sequence: */
@@ -3256,6 +3257,7 @@ win_line(
     {
 	extra_check = TRUE;
 	get_term_attr = TRUE;
+	term_attr = term_get_attr(wp->w_buffer, 0, 0);
     }
 #endif
 
@@ -5057,6 +5059,9 @@ win_line(
 # ifdef FEAT_DIFF
 			    diff_hlf != (hlf_T)0 ||
 # endif
+# ifdef FEAT_TERMINAL
+			    term_attr != 0 ||
+# endif
 			    line_attr != 0
 			) && (
 # ifdef FEAT_RIGHTLEFT
@@ -5091,6 +5096,15 @@ win_line(
 			}
 		    }
 # endif
+# ifdef FEAT_TERMINAL
+		    if (term_attr != 0)
+		    {
+			char_attr = term_attr;
+			if (wp->w_p_cul && lnum == wp->w_cursor.lnum)
+			    char_attr = hl_combine_attr(char_attr,
+							    HL_ATTR(HLF_CUL));
+		    }
+# endif
 		}
 #endif
 	    }