Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

avoid heavy redrawing cursor #1873

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
19 changes: 11 additions & 8 deletions src/terminal.c
Expand Up @@ -316,15 +316,18 @@ term_write_job_output(term_T *term, char_u *msg, size_t len)
}

static void
update_cursor()
update_cursor(int redraw)
{
/* TODO: this should not always be needed */
setcursor();
out_flush();
if (redraw)
{
out_flush();
#ifdef FEAT_GUI
if (gui.in_use)
gui_update_cursor(FALSE, FALSE);
if (gui.in_use)
gui_update_cursor(FALSE, FALSE);
#endif
}
}

/*
Expand All @@ -342,7 +345,7 @@ write_to_term(buf_T *buffer, char_u *msg, channel_T *channel)

/* TODO: only update once in a while. */
update_screen(0);
update_cursor();
update_cursor(FALSE);
}

/*
Expand Down Expand Up @@ -473,7 +476,7 @@ terminal_loop(void)
{
/* TODO: skip screen update when handling a sequence of keys. */
update_screen(0);
update_cursor();
update_cursor(FALSE);
++no_mapping;
++allow_keys;
got_int = FALSE;
Expand Down Expand Up @@ -561,7 +564,7 @@ term_job_ended(job_T *job)
if (did_one)
{
redraw_statuslines();
update_cursor();
update_cursor(TRUE);
}
if (curbuf->b_term != NULL && curbuf->b_term->tl_job == job)
maketitle();
Expand Down Expand Up @@ -626,7 +629,7 @@ handle_movecursor(
}

if (is_current)
update_cursor();
update_cursor(TRUE);

return 1;
}
Expand Down