Mercurial > vim
comparison src/screen.c @ 11655:8014350fe51a v8.0.0710
patch 8.0.0710: a job that writes to a buffer clears completion
commit https://github.com/vim/vim/commit/8603356bf41e4aa5fe1d7cffe3ee003745c167a6
Author: Bram Moolenaar <Bram@vim.org>
Date: Wed Jul 12 20:24:41 2017 +0200
patch 8.0.0710: a job that writes to a buffer clears completion
Problem: A job that writes to a buffer clears command line completion.
(Ramel Eshed)
Solution: Do not redraw while showing the completion menu.
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Wed, 12 Jul 2017 20:30:03 +0200 |
parents | 24664144de4e |
children | a7cd2a53590c |
comparison
equal
deleted
inserted
replaced
11654:f555f26d134e | 11655:8014350fe51a |
---|---|
273 void | 273 void |
274 redraw_buf_and_status_later(buf_T *buf, int type) | 274 redraw_buf_and_status_later(buf_T *buf, int type) |
275 { | 275 { |
276 win_T *wp; | 276 win_T *wp; |
277 | 277 |
278 if (wild_menu_showing != 0) | |
279 /* Don't redraw while the command line completion is displayed, it | |
280 * would disappear. */ | |
281 return; | |
278 FOR_ALL_WINDOWS(wp) | 282 FOR_ALL_WINDOWS(wp) |
279 { | 283 { |
280 if (wp->w_buffer == buf) | 284 if (wp->w_buffer == buf) |
281 { | 285 { |
282 redraw_win_later(wp, type); | 286 redraw_win_later(wp, type); |
442 { | 446 { |
443 if (State == HITRETURN || State == ASKMORE) | 447 if (State == HITRETURN || State == ASKMORE) |
444 ; /* do nothing */ | 448 ; /* do nothing */ |
445 else if (State & CMDLINE) | 449 else if (State & CMDLINE) |
446 { | 450 { |
447 /* Redrawing only works when the screen didn't scroll. */ | 451 /* Redrawing only works when the screen didn't scroll. Don't clear |
448 if (msg_scrolled == 0) | 452 * wildmenu entries. */ |
449 { | 453 if (msg_scrolled == 0 && wild_menu_showing == 0) |
450 update_screen(0); | 454 update_screen(0); |
451 compute_cmdrow(); | 455 /* Redraw in the same position, so that the user can continue |
452 } | 456 * editing the command. */ |
453 else | |
454 { | |
455 /* Redraw in the same position, so that the user can continue | |
456 * editing the command. */ | |
457 compute_cmdrow(); | |
458 if (cmdline_row > msg_scrolled) | |
459 cmdline_row -= msg_scrolled; | |
460 else | |
461 cmdline_row = 0; | |
462 } | |
463 redrawcmdline_ex(FALSE); | 457 redrawcmdline_ex(FALSE); |
464 } | 458 } |
465 else if (State & (NORMAL | INSERT)) | 459 else if (State & (NORMAL | INSERT)) |
466 { | 460 { |
467 /* keep the command line if possible */ | 461 /* keep the command line if possible */ |
9415 } | 9409 } |
9416 } | 9410 } |
9417 | 9411 |
9418 | 9412 |
9419 /* | 9413 /* |
9420 * insert 'line_count' lines at 'row' in window 'wp' | 9414 * Insert 'line_count' lines at 'row' in window 'wp'. |
9421 * if 'invalid' is TRUE the wp->w_lines[].wl_lnum is invalidated. | 9415 * If 'invalid' is TRUE the wp->w_lines[].wl_lnum is invalidated. |
9422 * if 'mayclear' is TRUE the screen will be cleared if it is faster than | 9416 * If 'mayclear' is TRUE the screen will be cleared if it is faster than |
9423 * scrolling. | 9417 * scrolling. |
9424 * Returns FAIL if the lines are not inserted, OK for success. | 9418 * Returns FAIL if the lines are not inserted, OK for success. |
9425 */ | 9419 */ |
9426 int | 9420 int |
9427 win_ins_lines( | 9421 win_ins_lines( |
9500 | 9494 |
9501 return OK; | 9495 return OK; |
9502 } | 9496 } |
9503 | 9497 |
9504 /* | 9498 /* |
9505 * delete "line_count" window lines at "row" in window "wp" | 9499 * Delete "line_count" window lines at "row" in window "wp". |
9506 * If "invalid" is TRUE curwin->w_lines[] is invalidated. | 9500 * If "invalid" is TRUE curwin->w_lines[] is invalidated. |
9507 * If "mayclear" is TRUE the screen will be cleared if it is faster than | 9501 * If "mayclear" is TRUE the screen will be cleared if it is faster than |
9508 * scrolling | 9502 * scrolling |
9509 * Return OK for success, FAIL if the lines are not deleted. | 9503 * Return OK for success, FAIL if the lines are not deleted. |
9510 */ | 9504 */ |