Mercurial > vim
comparison src/terminal.c @ 12578:f8beecfea2c4 v8.0.1167
patch 8.0.1167: Motif: typing in terminal window is slow
commit https://github.com/vim/vim/commit/3a497e1a414dc44b3df6a6fca60838ecd8ff0ca6
Author: Bram Moolenaar <Bram@vim.org>
Date: Sat Sep 30 20:40:27 2017 +0200
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.
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Sat, 30 Sep 2017 20:45:04 +0200 |
parents | fcb11cfca8b3 |
children | 3c46dcf3b335 |
comparison
equal
deleted
inserted
replaced
12577:146d737348b7 | 12578:f8beecfea2c4 |
---|---|
39 * | 39 * |
40 * TODO: | 40 * TODO: |
41 * - in GUI vertical split causes problems. Cursor is flickering. (Hirohito | 41 * - in GUI vertical split causes problems. Cursor is flickering. (Hirohito |
42 * Higashi, 2017 Sep 19) | 42 * Higashi, 2017 Sep 19) |
43 * - Shift-Tab does not work. | 43 * - Shift-Tab does not work. |
44 * - after resizing windows overlap. (Boris Staletic, #2164) | |
44 * - double click in Window toolbar starts Visual mode. | 45 * - double click in Window toolbar starts Visual mode. |
45 * - Redirecting output does not work on MS-Windows, Test_terminal_redir_file() | 46 * - Redirecting output does not work on MS-Windows, Test_terminal_redir_file() |
46 * is disabled. | 47 * is disabled. |
47 * - cursor blinks in terminal on widows with a timer. (xtal8, #2142) | 48 * - cursor blinks in terminal on widows with a timer. (xtal8, #2142) |
48 * - implement term_setsize() | 49 * - implement term_setsize() |
132 | 133 |
133 char_u *tl_title; /* NULL or allocated */ | 134 char_u *tl_title; /* NULL or allocated */ |
134 char_u *tl_status_text; /* NULL or allocated */ | 135 char_u *tl_status_text; /* NULL or allocated */ |
135 | 136 |
136 /* Range of screen rows to update. Zero based. */ | 137 /* 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 */ |
138 int tl_dirty_row_end; /* row below last one to update */ | 139 int tl_dirty_row_end; /* row below last one to update */ |
139 | 140 |
140 garray_T tl_scrollback; | 141 garray_T tl_scrollback; |
141 int tl_scrollback_scrolled; | 142 int tl_scrollback_scrolled; |
142 cellattr_T tl_default_color; | 143 cellattr_T tl_default_color; |
1923 win_del_lines(wp, dest.start_row, | 1924 win_del_lines(wp, dest.start_row, |
1924 src.start_row - dest.start_row, FALSE, FALSE, | 1925 src.start_row - dest.start_row, FALSE, FALSE, |
1925 clear_attr); | 1926 clear_attr); |
1926 } | 1927 } |
1927 } | 1928 } |
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 | |
1928 redraw_buf_later(term->tl_buffer, NOT_VALID); | 1933 redraw_buf_later(term->tl_buffer, NOT_VALID); |
1929 return 1; | 1934 return 1; |
1930 } | 1935 } |
1931 | 1936 |
1932 static int | 1937 static int |
2266 | 2271 |
2267 /* The cursor may have been moved when resizing. */ | 2272 /* The cursor may have been moved when resizing. */ |
2268 vterm_state_get_cursorpos(state, &pos); | 2273 vterm_state_get_cursorpos(state, &pos); |
2269 position_cursor(wp, &pos); | 2274 position_cursor(wp, &pos); |
2270 | 2275 |
2271 /* TODO: Only redraw what changed. */ | 2276 for (pos.row = term->tl_dirty_row_start; pos.row < term->tl_dirty_row_end |
2272 for (pos.row = 0; pos.row < wp->w_height; ++pos.row) | 2277 && pos.row < wp->w_height; ++pos.row) |
2273 { | 2278 { |
2274 int off = screen_get_current_line_off(); | 2279 int off = screen_get_current_line_off(); |
2275 int max_col = MIN(wp->w_width, term->tl_cols); | 2280 int max_col = MIN(wp->w_width, term->tl_cols); |
2276 | 2281 |
2277 if (pos.row < term->tl_rows) | 2282 if (pos.row < term->tl_rows) |
2350 pos.col = 0; | 2355 pos.col = 0; |
2351 | 2356 |
2352 screen_line(wp->w_winrow + pos.row, wp->w_wincol, | 2357 screen_line(wp->w_winrow + pos.row, wp->w_wincol, |
2353 pos.col, wp->w_width, FALSE); | 2358 pos.col, wp->w_width, FALSE); |
2354 } | 2359 } |
2360 term->tl_dirty_row_start = MAX_ROW; | |
2361 term->tl_dirty_row_end = 0; | |
2355 | 2362 |
2356 return OK; | 2363 return OK; |
2357 } | 2364 } |
2358 | 2365 |
2359 /* | 2366 /* |