forked from aniani/vim
patch 8.0.0771: cursor in terminal window not always updated in GUI
Problem: Cursor in a terminal window not always updated in the GUI. Solution: Call gui_update_cursor(). (Yasuhiro Matsumoto, closes #1868)
This commit is contained in:
@@ -33,7 +33,8 @@
|
|||||||
* while, if the terminal window is visible, the screen contents is drawn.
|
* while, if the terminal window is visible, the screen contents is drawn.
|
||||||
*
|
*
|
||||||
* TODO:
|
* TODO:
|
||||||
* - do not store terminal buffer in viminfo
|
* - include functions from #1871
|
||||||
|
* - do not store terminal buffer in viminfo. Or prefix term:// ?
|
||||||
* - Add a scrollback buffer (contains lines to scroll off the top).
|
* - Add a scrollback buffer (contains lines to scroll off the top).
|
||||||
* Can use the buf_T lines, store attributes somewhere else?
|
* Can use the buf_T lines, store attributes somewhere else?
|
||||||
* - When the job ends:
|
* - When the job ends:
|
||||||
@@ -314,6 +315,18 @@ term_write_job_output(term_T *term, char_u *msg, size_t len)
|
|||||||
vterm_screen_flush_damage(vterm_obtain_screen(vterm));
|
vterm_screen_flush_damage(vterm_obtain_screen(vterm));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
update_cursor()
|
||||||
|
{
|
||||||
|
/* TODO: this should not always be needed */
|
||||||
|
setcursor();
|
||||||
|
out_flush();
|
||||||
|
#ifdef FEAT_GUI
|
||||||
|
if (gui.in_use)
|
||||||
|
gui_update_cursor(FALSE, FALSE);
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Invoked when "msg" output from a job was received. Write it to the terminal
|
* Invoked when "msg" output from a job was received. Write it to the terminal
|
||||||
* of "buffer".
|
* of "buffer".
|
||||||
@@ -329,8 +342,7 @@ write_to_term(buf_T *buffer, char_u *msg, channel_T *channel)
|
|||||||
|
|
||||||
/* TODO: only update once in a while. */
|
/* TODO: only update once in a while. */
|
||||||
update_screen(0);
|
update_screen(0);
|
||||||
setcursor();
|
update_cursor();
|
||||||
out_flush();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -461,8 +473,7 @@ terminal_loop(void)
|
|||||||
{
|
{
|
||||||
/* TODO: skip screen update when handling a sequence of keys. */
|
/* TODO: skip screen update when handling a sequence of keys. */
|
||||||
update_screen(0);
|
update_screen(0);
|
||||||
setcursor();
|
update_cursor();
|
||||||
out_flush();
|
|
||||||
++no_mapping;
|
++no_mapping;
|
||||||
++allow_keys;
|
++allow_keys;
|
||||||
got_int = FALSE;
|
got_int = FALSE;
|
||||||
@@ -550,8 +561,7 @@ term_job_ended(job_T *job)
|
|||||||
if (did_one)
|
if (did_one)
|
||||||
{
|
{
|
||||||
redraw_statuslines();
|
redraw_statuslines();
|
||||||
setcursor();
|
update_cursor();
|
||||||
out_flush();
|
|
||||||
}
|
}
|
||||||
if (curbuf->b_term != NULL && curbuf->b_term->tl_job == job)
|
if (curbuf->b_term != NULL && curbuf->b_term->tl_job == job)
|
||||||
maketitle();
|
maketitle();
|
||||||
@@ -616,10 +626,7 @@ handle_movecursor(
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (is_current)
|
if (is_current)
|
||||||
{
|
update_cursor();
|
||||||
setcursor();
|
|
||||||
out_flush();
|
|
||||||
}
|
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
@@ -769,6 +769,8 @@ static char *(features[]) =
|
|||||||
|
|
||||||
static int included_patches[] =
|
static int included_patches[] =
|
||||||
{ /* Add new patch number below this line */
|
{ /* Add new patch number below this line */
|
||||||
|
/**/
|
||||||
|
771,
|
||||||
/**/
|
/**/
|
||||||
770,
|
770,
|
||||||
/**/
|
/**/
|
||||||
|
Reference in New Issue
Block a user