Skip to content

Commit 3a497e1

Browse files
committed
patch 8.0.1167: Motif: typing in terminal window is slow
Problem: Motif: typing in terminal window is slow. Solution: Do not redraw the whole terminal window but only was was changed.
1 parent c958b31 commit 3a497e1

File tree

2 files changed

+12
-3
lines changed

2 files changed

+12
-3
lines changed

src/terminal.c

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@
4141
* - in GUI vertical split causes problems. Cursor is flickering. (Hirohito
4242
* Higashi, 2017 Sep 19)
4343
* - Shift-Tab does not work.
44+
* - after resizing windows overlap. (Boris Staletic, #2164)
4445
* - double click in Window toolbar starts Visual mode.
4546
* - Redirecting output does not work on MS-Windows, Test_terminal_redir_file()
4647
* is disabled.
@@ -134,7 +135,7 @@ struct terminal_S {
134135
char_u *tl_status_text; /* NULL or allocated */
135136

136137
/* Range of screen rows to update. Zero based. */
137-
int tl_dirty_row_start; /* -1 if nothing dirty */
138+
int tl_dirty_row_start; /* MAX_ROW if nothing dirty */
138139
int tl_dirty_row_end; /* row below last one to update */
139140

140141
garray_T tl_scrollback;
@@ -1925,6 +1926,10 @@ handle_moverect(VTermRect dest, VTermRect src, void *user)
19251926
clear_attr);
19261927
}
19271928
}
1929+
1930+
term->tl_dirty_row_start = MIN(term->tl_dirty_row_start, dest.start_row);
1931+
term->tl_dirty_row_end = MIN(term->tl_dirty_row_end, dest.end_row);
1932+
19281933
redraw_buf_later(term->tl_buffer, NOT_VALID);
19291934
return 1;
19301935
}
@@ -2268,8 +2273,8 @@ term_update_window(win_T *wp)
22682273
vterm_state_get_cursorpos(state, &pos);
22692274
position_cursor(wp, &pos);
22702275

2271-
/* TODO: Only redraw what changed. */
2272-
for (pos.row = 0; pos.row < wp->w_height; ++pos.row)
2276+
for (pos.row = term->tl_dirty_row_start; pos.row < term->tl_dirty_row_end
2277+
&& pos.row < wp->w_height; ++pos.row)
22732278
{
22742279
int off = screen_get_current_line_off();
22752280
int max_col = MIN(wp->w_width, term->tl_cols);
@@ -2352,6 +2357,8 @@ term_update_window(win_T *wp)
23522357
screen_line(wp->w_winrow + pos.row, wp->w_wincol,
23532358
pos.col, wp->w_width, FALSE);
23542359
}
2360+
term->tl_dirty_row_start = MAX_ROW;
2361+
term->tl_dirty_row_end = 0;
23552362

23562363
return OK;
23572364
}

src/version.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -761,6 +761,8 @@ static char *(features[]) =
761761

762762
static int included_patches[] =
763763
{ /* Add new patch number below this line */
764+
/**/
765+
1167,
764766
/**/
765767
1166,
766768
/**/

0 commit comments

Comments
 (0)