Mercurial > vim
comparison src/drawscreen.c @ 19542:9e428147e4ee v8.2.0328
patch 8.2.0328: no redraw when leaving term-normal mode in popup terminal
Commit: https://github.com/vim/vim/commit/e52e0c89d1a6305beca3c01f89a4892dcb43bc71
Author: Bram Moolenaar <Bram@vim.org>
Date: Fri Feb 28 22:20:10 2020 +0100
patch 8.2.0328: no redraw when leaving term-normal mode in popup terminal
Problem: No redraw when leaving terminal-normal mode in a terminal popup
window.
Solution: Redraw the popup window. (closes #5708)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Fri, 28 Feb 2020 22:30:09 +0100 |
parents | 5c405689da3e |
children | dcec86d796bc |
comparison
equal
deleted
inserted
replaced
19541:80dd4d7df929 | 19542:9e428147e4ee |
---|---|
67 | 67 |
68 static void win_update(win_T *wp); | 68 static void win_update(win_T *wp); |
69 #ifdef FEAT_STL_OPT | 69 #ifdef FEAT_STL_OPT |
70 static void redraw_custom_statusline(win_T *wp); | 70 static void redraw_custom_statusline(win_T *wp); |
71 #endif | 71 #endif |
72 #if defined(FEAT_SEARCH_EXTRA) || defined(FEAT_CLIPBOARD) | |
73 static int did_update_one_window; | |
74 #endif | |
72 | 75 |
73 /* | 76 /* |
74 * Based on the current value of curwin->w_topline, transfer a screenfull | 77 * Based on the current value of curwin->w_topline, transfer a screenfull |
75 * of stuff from Filemem to ScreenLines[], and update curwin->w_botline. | 78 * of stuff from Filemem to ScreenLines[], and update curwin->w_botline. |
76 * Return OK when the screen was updated, FAIL if it was not done. | 79 * Return OK when the screen was updated, FAIL if it was not done. |
79 update_screen(int type_arg) | 82 update_screen(int type_arg) |
80 { | 83 { |
81 int type = type_arg; | 84 int type = type_arg; |
82 win_T *wp; | 85 win_T *wp; |
83 static int did_intro = FALSE; | 86 static int did_intro = FALSE; |
84 #if defined(FEAT_SEARCH_EXTRA) || defined(FEAT_CLIPBOARD) | |
85 int did_one; | |
86 #endif | |
87 #ifdef FEAT_GUI | 87 #ifdef FEAT_GUI |
88 int did_one = FALSE; | |
88 int did_undraw = FALSE; | 89 int did_undraw = FALSE; |
89 int gui_cursor_col = 0; | 90 int gui_cursor_col = 0; |
90 int gui_cursor_row = 0; | 91 int gui_cursor_row = 0; |
91 #endif | 92 #endif |
92 int no_update = FALSE; | 93 int no_update = FALSE; |
274 #endif | 275 #endif |
275 | 276 |
276 // Go from top to bottom through the windows, redrawing the ones that need | 277 // Go from top to bottom through the windows, redrawing the ones that need |
277 // it. | 278 // it. |
278 #if defined(FEAT_SEARCH_EXTRA) || defined(FEAT_CLIPBOARD) | 279 #if defined(FEAT_SEARCH_EXTRA) || defined(FEAT_CLIPBOARD) |
279 did_one = FALSE; | 280 did_update_one_window = FALSE; |
280 #endif | 281 #endif |
281 #ifdef FEAT_SEARCH_EXTRA | 282 #ifdef FEAT_SEARCH_EXTRA |
282 screen_search_hl.rm.regprog = NULL; | 283 screen_search_hl.rm.regprog = NULL; |
283 #endif | 284 #endif |
284 FOR_ALL_WINDOWS(wp) | 285 FOR_ALL_WINDOWS(wp) |
285 { | 286 { |
286 if (wp->w_redr_type != 0) | 287 if (wp->w_redr_type != 0) |
287 { | 288 { |
288 cursor_off(); | 289 cursor_off(); |
289 #if defined(FEAT_SEARCH_EXTRA) || defined(FEAT_CLIPBOARD) | 290 #ifdef FEAT_GUI |
290 if (!did_one) | 291 if (!did_one) |
291 { | 292 { |
292 did_one = TRUE; | 293 did_one = TRUE; |
293 # ifdef FEAT_SEARCH_EXTRA | 294 |
294 start_search_hl(); | |
295 # endif | |
296 # ifdef FEAT_CLIPBOARD | |
297 // When Visual area changed, may have to update selection. | |
298 if (clip_star.available && clip_isautosel_star()) | |
299 clip_update_selection(&clip_star); | |
300 if (clip_plus.available && clip_isautosel_plus()) | |
301 clip_update_selection(&clip_plus); | |
302 # endif | |
303 #ifdef FEAT_GUI | |
304 // Remove the cursor before starting to do anything, because | 295 // Remove the cursor before starting to do anything, because |
305 // scrolling may make it difficult to redraw the text under | 296 // scrolling may make it difficult to redraw the text under |
306 // it. | 297 // it. |
307 if (gui.in_use && wp == curwin) | 298 if (gui.in_use && wp == curwin) |
308 { | 299 { |
309 gui_cursor_col = gui.cursor_col; | 300 gui_cursor_col = gui.cursor_col; |
310 gui_cursor_row = gui.cursor_row; | 301 gui_cursor_row = gui.cursor_row; |
311 gui_undraw_cursor(); | 302 gui_undraw_cursor(); |
312 did_undraw = TRUE; | 303 did_undraw = TRUE; |
313 } | 304 } |
314 #endif | 305 } |
315 } | 306 #endif |
316 #endif | 307 |
317 win_update(wp); | 308 win_update(wp); |
318 } | 309 } |
319 | 310 |
320 // redraw status line after the window to minimize cursor movement | 311 // redraw status line after the window to minimize cursor movement |
321 if (wp->w_redr_status) | 312 if (wp->w_redr_status) |
1418 #if defined(FEAT_SYN_HL) || defined(FEAT_SEARCH_EXTRA) | 1409 #if defined(FEAT_SYN_HL) || defined(FEAT_SEARCH_EXTRA) |
1419 int save_got_int; | 1410 int save_got_int; |
1420 #endif | 1411 #endif |
1421 #ifdef SYN_TIME_LIMIT | 1412 #ifdef SYN_TIME_LIMIT |
1422 proftime_T syntax_tm; | 1413 proftime_T syntax_tm; |
1414 #endif | |
1415 | |
1416 #if defined(FEAT_SEARCH_EXTRA) || defined(FEAT_CLIPBOARD) | |
1417 // This needs to be done only for the first window when update_screen() is | |
1418 // called. | |
1419 if (!did_update_one_window) | |
1420 { | |
1421 did_update_one_window = TRUE; | |
1422 # ifdef FEAT_SEARCH_EXTRA | |
1423 start_search_hl(); | |
1424 # endif | |
1425 # ifdef FEAT_CLIPBOARD | |
1426 // When Visual area changed, may have to update selection. | |
1427 if (clip_star.available && clip_isautosel_star()) | |
1428 clip_update_selection(&clip_star); | |
1429 if (clip_plus.available && clip_isautosel_plus()) | |
1430 clip_update_selection(&clip_plus); | |
1431 # endif | |
1432 } | |
1423 #endif | 1433 #endif |
1424 | 1434 |
1425 type = wp->w_redr_type; | 1435 type = wp->w_redr_type; |
1426 | 1436 |
1427 if (type == NOT_VALID) | 1437 if (type == NOT_VALID) |
3023 FOR_ALL_WINDOWS(wp) | 3033 FOR_ALL_WINDOWS(wp) |
3024 { | 3034 { |
3025 if (wp->w_buffer == buf) | 3035 if (wp->w_buffer == buf) |
3026 redraw_win_later(wp, type); | 3036 redraw_win_later(wp, type); |
3027 } | 3037 } |
3038 #if defined(FEAT_TERMINAL) && defined(FEAT_PROP_POPUP) | |
3039 // terminal in popup window is not in list of windows | |
3040 if (curwin->w_buffer == buf) | |
3041 redraw_win_later(curwin, type); | |
3042 #endif | |
3028 } | 3043 } |
3029 | 3044 |
3030 #if defined(FEAT_SIGNS) || defined(PROTO) | 3045 #if defined(FEAT_SIGNS) || defined(PROTO) |
3031 void | 3046 void |
3032 redraw_buf_line_later(buf_T *buf, linenr_T lnum) | 3047 redraw_buf_line_later(buf_T *buf, linenr_T lnum) |