comparison src/edit.c @ 13150:808625d4b71b v8.0.1449

patch 8.0.1449: slow redrawing with DirectX commit https://github.com/vim/vim/commit/a338adcf222b6a24e26ea5ae6a2ad27f914acb38 Author: Bram Moolenaar <Bram@vim.org> Date: Wed Jan 31 20:51:47 2018 +0100 patch 8.0.1449: slow redrawing with DirectX Problem: Slow redrawing with DirectX. Solution: Avoid calling gui_mch_flush() unnecessarily, especially when updating the cursor. (Ken Takata, closes #2560)
author Christian Brabandt <cb@256bit.org>
date Wed, 31 Jan 2018 21:00:08 +0100
parents 004bc78c88e6
children c1534eb682a6
comparison
equal deleted inserted replaced
13149:46794b7ab97a 13150:808625d4b71b
3449 edit_submode_extra = NULL; 3449 edit_submode_extra = NULL;
3450 vim_free(compl_orig_text); 3450 vim_free(compl_orig_text);
3451 compl_orig_text = NULL; 3451 compl_orig_text = NULL;
3452 compl_enter_selects = FALSE; 3452 compl_enter_selects = FALSE;
3453 /* clear v:completed_item */ 3453 /* clear v:completed_item */
3454 set_vim_var_dict(VV_COMPLETED_ITEM, dict_alloc()); 3454 set_vim_var_dict(VV_COMPLETED_ITEM, dict_alloc_lock(VAR_FIXED));
3455 } 3455 }
3456 3456
3457 /* 3457 /*
3458 * Return TRUE when Insert completion is active. 3458 * Return TRUE when Insert completion is active.
3459 */ 3459 */
3551 #ifdef FEAT_GUI 3551 #ifdef FEAT_GUI
3552 if (gui.in_use) 3552 if (gui.in_use)
3553 { 3553 {
3554 /* Show the cursor after the match, not after the redrawn text. */ 3554 /* Show the cursor after the match, not after the redrawn text. */
3555 setcursor(); 3555 setcursor();
3556 out_flush(); 3556 out_flush_cursor(FALSE, FALSE);
3557 gui_update_cursor(FALSE, FALSE);
3558 } 3557 }
3559 #endif 3558 #endif
3560 compl_restarting = TRUE; 3559 compl_restarting = TRUE;
3561 if (ins_complete(Ctrl_N, TRUE) == FAIL) 3560 if (ins_complete(Ctrl_N, TRUE) == FAIL)
3562 compl_cont_status = 0; 3561 compl_cont_status = 0;
4702 4701
4703 /* TODO: is this sufficient for redrawing? Redrawing everything causes 4702 /* TODO: is this sufficient for redrawing? Redrawing everything causes
4704 * flicker, thus we can't do that. */ 4703 * flicker, thus we can't do that. */
4705 changed_cline_bef_curs(); 4704 changed_cline_bef_curs();
4706 /* clear v:completed_item */ 4705 /* clear v:completed_item */
4707 set_vim_var_dict(VV_COMPLETED_ITEM, dict_alloc()); 4706 set_vim_var_dict(VV_COMPLETED_ITEM, dict_alloc_lock(VAR_FIXED));
4708 } 4707 }
4709 4708
4710 /* 4709 /*
4711 * Insert the new text being completed. 4710 * Insert the new text being completed.
4712 * "in_compl_func" is TRUE when called from complete_check(). 4711 * "in_compl_func" is TRUE when called from complete_check().
4722 else 4721 else
4723 compl_used_match = TRUE; 4722 compl_used_match = TRUE;
4724 4723
4725 /* Set completed item. */ 4724 /* Set completed item. */
4726 /* { word, abbr, menu, kind, info } */ 4725 /* { word, abbr, menu, kind, info } */
4727 dict = dict_alloc(); 4726 dict = dict_alloc_lock(VAR_FIXED);
4728 if (dict != NULL) 4727 if (dict != NULL)
4729 { 4728 {
4730 dict_add_nr_str(dict, "word", 0L, 4729 dict_add_nr_str(dict, "word", 0L,
4731 EMPTY_IF_NULL(compl_shown_match->cp_str)); 4730 EMPTY_IF_NULL(compl_shown_match->cp_str));
4732 dict_add_nr_str(dict, "abbr", 0L, 4731 dict_add_nr_str(dict, "abbr", 0L,
4934 #ifdef FEAT_GUI 4933 #ifdef FEAT_GUI
4935 if (gui.in_use) 4934 if (gui.in_use)
4936 { 4935 {
4937 /* Show the cursor after the match, not after the redrawn text. */ 4936 /* Show the cursor after the match, not after the redrawn text. */
4938 setcursor(); 4937 setcursor();
4939 out_flush(); 4938 out_flush_cursor(FALSE, FALSE);
4940 gui_update_cursor(FALSE, FALSE);
4941 } 4939 }
4942 #endif 4940 #endif
4943 4941
4944 /* Delete old text to be replaced, since we're still searching and 4942 /* Delete old text to be replaced, since we're still searching and
4945 * don't want to match ourselves! */ 4943 * don't want to match ourselves! */