patch 8.0.0824: in Terminal mode the cursor and screen gets redrawn
Problem: In Terminal mode the cursor and screen gets redrawn when the job
produces output.
Solution: Check for tl_terminal_mode. (partly by Yasuhiro Matsumoto, closes
#1904)
diff --git a/src/terminal.c b/src/terminal.c
index 1f155db..1423c5f 100644
--- a/src/terminal.c
+++ b/src/terminal.c
@@ -36,6 +36,9 @@
* that buffer, attributes come from the scrollback buffer tl_scrollback.
*
* TODO:
+ * - Use "." for current line instead of optional.
+ * - make row and cols one-based instead of zero-based in term_ functions.
+ * - Add StatusLineTerm highlighting
* - in bash mouse clicks are inserting characters.
* - mouse scroll: when over other window, scroll that window.
* - For the scrollback buffer store lines in the buffer, only attributes in
@@ -351,6 +354,8 @@
static void
update_cursor(term_T *term, int redraw)
{
+ if (term->tl_terminal_mode)
+ return;
setcursor();
if (redraw && term->tl_buffer == curbuf)
{
@@ -382,9 +387,12 @@
ch_logn(channel, "writing %d bytes to terminal", (int)len);
term_write_job_output(term, msg, len);
- /* TODO: only update once in a while. */
- update_screen(0);
- update_cursor(term, TRUE);
+ if (!term->tl_terminal_mode)
+ {
+ /* TODO: only update once in a while. */
+ update_screen(0);
+ update_cursor(term, TRUE);
+ }
}
/*
@@ -1081,7 +1089,7 @@
if (wp->w_buffer == term->tl_buffer)
position_cursor(wp, &pos);
}
- if (term->tl_buffer == curbuf)
+ if (term->tl_buffer == curbuf && !term->tl_terminal_mode)
{
may_toggle_cursor(term);
update_cursor(term, term->tl_cursor_visible);
@@ -2009,10 +2017,13 @@
msg += MB_PTR2LEN(msg);
}
- /* TODO: only update once in a while. */
- update_screen(0);
- if (buf == curbuf)
- update_cursor(term, TRUE);
+ if (!term->tl_terminal_mode)
+ {
+ /* TODO: only update once in a while. */
+ update_screen(0);
+ if (buf == curbuf)
+ update_cursor(term, TRUE);
+ }
}
/*
diff --git a/src/version.c b/src/version.c
index 9c94c98..5a3c164 100644
--- a/src/version.c
+++ b/src/version.c
@@ -770,6 +770,8 @@
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
+ 824,
+/**/
823,
/**/
822,