comparison src/normal.c @ 19681:e21c22c58e2b v8.2.0397

patch 8.2.0397: delayed screen update when using undo from Insert mode Commit: https://github.com/vim/vim/commit/5715b3147bfc8ddfe905339f6fd224fd3a5a3ba1 Author: Bram Moolenaar <Bram@vim.org> Date: Mon Mar 16 22:08:45 2020 +0100 patch 8.2.0397: delayed screen update when using undo from Insert mode Problem: Delayed screen update when using undo from Insert mode. Solution: Update w_topline and cursor shape before sleeping. (closes https://github.com/vim/vim/issues/5790)
author Bram Moolenaar <Bram@vim.org>
date Mon, 16 Mar 2020 22:15:04 +0100
parents 5512aa74cb62
children aadd1cae2ff5
comparison
equal deleted inserted replaced
19680:842f0a26377d 19681:e21c22c58e2b
1152 { 1152 {
1153 char_u *kmsg; 1153 char_u *kmsg;
1154 1154
1155 kmsg = keep_msg; 1155 kmsg = keep_msg;
1156 keep_msg = NULL; 1156 keep_msg = NULL;
1157 // showmode() will clear keep_msg, but we want to use it anyway 1157 // Showmode() will clear keep_msg, but we want to use it anyway.
1158 // First update w_topline.
1159 setcursor();
1158 update_screen(0); 1160 update_screen(0);
1159 // now reset it, otherwise it's put in the history again 1161 // now reset it, otherwise it's put in the history again
1160 keep_msg = kmsg; 1162 keep_msg = kmsg;
1161 1163
1162 kmsg = vim_strsave(keep_msg); 1164 kmsg = vim_strsave(keep_msg);
1165 msg_attr((char *)kmsg, keep_msg_attr); 1167 msg_attr((char *)kmsg, keep_msg_attr);
1166 vim_free(kmsg); 1168 vim_free(kmsg);
1167 } 1169 }
1168 } 1170 }
1169 setcursor(); 1171 setcursor();
1172 #ifdef CURSOR_SHAPE
1173 ui_cursor_shape(); // may show different cursor shape
1174 #endif
1170 cursor_on(); 1175 cursor_on();
1171 out_flush(); 1176 out_flush();
1172 if (msg_scroll || emsg_on_display) 1177 if (msg_scroll || emsg_on_display)
1173 ui_delay(1003L, TRUE); // wait at least one second 1178 ui_delay(1003L, TRUE); // wait at least one second
1174 ui_delay(3003L, FALSE); // wait up to three seconds 1179 ui_delay(3003L, FALSE); // wait up to three seconds
1278 *set_prevcount = FALSE; // only set v:prevcount once 1283 *set_prevcount = FALSE; // only set v:prevcount once
1279 } 1284 }
1280 #endif 1285 #endif
1281 1286
1282 /* 1287 /*
1283 * Check if highlighting for visual mode is possible, give a warning message 1288 * Check if highlighting for Visual mode is possible, give a warning message
1284 * if not. 1289 * if not.
1285 */ 1290 */
1286 void 1291 void
1287 check_visual_highlight(void) 1292 check_visual_highlight(void)
1288 { 1293 {