diff src/screen.c @ 11670:3b2afa2b77b3 v8.0.0718

patch 8.0.0718: output of job in terminal is not displayed commit https://github.com/vim/vim/commit/cb8bbe9bf3214d07580d6b43d6539416884153bd Author: Bram Moolenaar <Bram@vim.org> Date: Sun Jul 16 13:48:22 2017 +0200 patch 8.0.0718: output of job in terminal is not displayed Problem: Output of job in terminal is not displayed. Solution: Connect the job output to the terminal.
author Christian Brabandt <cb@256bit.org>
date Sun, 16 Jul 2017 14:00:03 +0200
parents a7cd2a53590c
children 3c6cc2f24645
line wrap: on
line diff
--- a/src/screen.c
+++ b/src/screen.c
@@ -126,13 +126,6 @@ static void copy_text_attr(int off, char
 #endif
 static int win_line(win_T *, linenr_T, int, int, int nochange, proftime_T *syntax_tm);
 static int char_needs_redraw(int off_from, int off_to, int cols);
-#ifdef FEAT_RIGHTLEFT
-static void screen_line(int row, int coloff, int endcol, int clear_width, int rlflag);
-# define SCREEN_LINE(r, o, e, c, rl)    screen_line((r), (o), (e), (c), (rl))
-#else
-static void screen_line(int row, int coloff, int endcol, int clear_width);
-# define SCREEN_LINE(r, o, e, c, rl)    screen_line((r), (o), (e), (c))
-#endif
 #ifdef FEAT_WINDOWS
 static void draw_vsep_win(win_T *wp, int row);
 #endif
@@ -411,7 +404,7 @@ redraw_asap(int type)
 				screenline2 + r * cols,
 				(size_t)cols * sizeof(schar_T));
 #endif
-		SCREEN_LINE(cmdline_row + r, 0, cols, cols, FALSE);
+		screen_line(cmdline_row + r, 0, cols, cols, FALSE);
 	    }
 	    ret = 4;
 	}
@@ -1192,6 +1185,17 @@ win_update(win_T *wp)
     }
 #endif
 
+#ifdef FEAT_TERMINAL
+    if (wp->w_buffer->b_term != NULL)
+    {
+	/* This window contains a terminal, redraw works completely
+	 * differently. */
+	term_update_window(wp);
+	wp->w_redr_type = 0;
+	return;
+    }
+#endif
+
 #ifdef FEAT_SEARCH_EXTRA
     init_search_hl(wp);
 #endif
@@ -2886,7 +2890,7 @@ fold_line(
     }
 #endif
 
-    SCREEN_LINE(row + W_WINROW(wp), W_WINCOL(wp), (int)W_WIDTH(wp),
+    screen_line(row + W_WINROW(wp), W_WINCOL(wp), (int)W_WIDTH(wp),
 						     (int)W_WIDTH(wp), FALSE);
 
     /*
@@ -3996,7 +4000,7 @@ win_line(
 #endif
 		)
 	{
-	    SCREEN_LINE(screen_row, W_WINCOL(wp), col, -(int)W_WIDTH(wp),
+	    screen_line(screen_row, W_WINCOL(wp), col, -(int)W_WIDTH(wp),
 								  wp->w_p_rl);
 	    /* Pretend we have finished updating the window.  Except when
 	     * 'cursorcolumn' is set. */
@@ -5443,7 +5447,7 @@ win_line(
 	    }
 #endif
 
-	    SCREEN_LINE(screen_row, W_WINCOL(wp), col,
+	    screen_line(screen_row, W_WINCOL(wp), col,
 						(int)W_WIDTH(wp), wp->w_p_rl);
 	    row++;
 
@@ -5749,11 +5753,11 @@ win_line(
 		)
 	{
 #ifdef FEAT_CONCEAL
-	    SCREEN_LINE(screen_row, W_WINCOL(wp), col - boguscols,
+	    screen_line(screen_row, W_WINCOL(wp), col - boguscols,
 						(int)W_WIDTH(wp), wp->w_p_rl);
 	    boguscols = 0;
 #else
-	    SCREEN_LINE(screen_row, W_WINCOL(wp), col,
+	    screen_line(screen_row, W_WINCOL(wp), col,
 						(int)W_WIDTH(wp), wp->w_p_rl);
 #endif
 	    ++row;
@@ -5959,6 +5963,17 @@ char_needs_redraw(int off_from, int off_
     return FALSE;
 }
 
+#if defined(FEAT_TERMINAL) || defined(PROTO)
+/*
+ * Return the index in ScreenLines[] for the current screen line.
+ */
+    int
+screen_get_current_line_off()
+{
+    return (int)(current_ScreenLine - ScreenLines);
+}
+#endif
+
 /*
  * Move one "cooked" screen line to the screen, but only the characters that
  * have actually changed.  Handle insert/delete character.
@@ -5970,16 +5985,13 @@ char_needs_redraw(int off_from, int off_
  *    When TRUE and "clear_width" > 0, clear columns 0 to "endcol"
  *    When FALSE and "clear_width" > 0, clear columns "endcol" to "clear_width"
  */
-    static void
+    void
 screen_line(
     int	    row,
     int	    coloff,
     int	    endcol,
-    int	    clear_width
-#ifdef FEAT_RIGHTLEFT
-    , int   rlflag
-#endif
-    )
+    int	    clear_width,
+    int	    rlflag UNUSED)
 {
     unsigned	    off_from;
     unsigned	    off_to;