diff options
author | James McCoy <jamessan@jamessan.com> | 2021-12-09 21:13:16 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-12-09 21:13:16 -0500 |
commit | b20871526ee6de12545d70020bfbac372921b3bf (patch) | |
tree | 911e7bbb9a035b44aea04cadcaacfeec98251ed2 /src | |
parent | 0cf546508d3bb3f51fc1d440ce5bd798edd70e82 (diff) | |
parent | c83fedf0bd0cb39ed4706113029b3e358f141707 (diff) | |
download | rneovim-b20871526ee6de12545d70020bfbac372921b3bf.tar.gz rneovim-b20871526ee6de12545d70020bfbac372921b3bf.tar.bz2 rneovim-b20871526ee6de12545d70020bfbac372921b3bf.zip |
Merge pull request #16414 from zeertzjq/terminal-no-invalid-rows
fix(terminal): return early if there are no invalid rows
Diffstat (limited to 'src')
-rw-r--r-- | src/nvim/terminal.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/nvim/terminal.c b/src/nvim/terminal.c index afebda4948..2d32b6bac4 100644 --- a/src/nvim/terminal.c +++ b/src/nvim/terminal.c @@ -1507,6 +1507,13 @@ static void refresh_screen(Terminal *term, buf_T *buf) // Terminal height may have decreased before `invalid_end` reflects it. term->invalid_end = MIN(term->invalid_end, height); + // There are no invalid rows. + if (term->invalid_start >= term->invalid_end) { + term->invalid_start = INT_MAX; + term->invalid_end = -1; + return; + } + for (int r = term->invalid_start, linenr = row_to_linenr(term, r); r < term->invalid_end; r++, linenr++) { fetch_row(term, r, width); |