comparison src/edit.c @ 8943:47036dcd83a4 v7.4.1757

commit https://github.com/vim/vim/commit/8e42ae5069d4985869e46eaa56900ed19e30f504 Author: Bram Moolenaar <Bram@vim.org> Date: Wed Apr 20 16:39:19 2016 +0200 patch 7.4.1757 Problem: When using complete() it may set 'modified' even though nothing was inserted. Solution: Use Down/Up instead of Next/Previous match. (Shougo, closes https://github.com/vim/vim/issues/745)
author Christian Brabandt <cb@256bit.org>
date Wed, 20 Apr 2016 16:45:05 +0200
parents 219d80fee92f
children a3060addc328
comparison
equal deleted inserted replaced
8942:7a880d638cf7 8943:47036dcd83a4
2811 compl_started = TRUE; 2811 compl_started = TRUE;
2812 compl_used_match = TRUE; 2812 compl_used_match = TRUE;
2813 compl_cont_status = 0; 2813 compl_cont_status = 0;
2814 2814
2815 compl_curr_match = compl_first_match; 2815 compl_curr_match = compl_first_match;
2816 if (compl_no_insert) 2816 if (compl_no_insert || compl_no_select)
2817 {
2817 ins_complete(K_DOWN, FALSE); 2818 ins_complete(K_DOWN, FALSE);
2819 if (compl_no_select)
2820 /* Down/Up has no real effect. */
2821 ins_complete(K_UP, FALSE);
2822 }
2818 else 2823 else
2819 ins_complete(Ctrl_N, FALSE); 2824 ins_complete(Ctrl_N, FALSE);
2820 if (compl_no_select)
2821 ins_complete(Ctrl_P, FALSE);
2822 2825
2823 /* Lazily show the popup menu, unless we got interrupted. */ 2826 /* Lazily show the popup menu, unless we got interrupted. */
2824 if (!compl_interrupted) 2827 if (!compl_interrupted)
2825 show_pum(save_w_wrow); 2828 show_pum(save_w_wrow);
2826 out_flush(); 2829 out_flush();
4967 */ 4970 */
4968 static int 4971 static int
4969 ins_compl_key2dir(int c) 4972 ins_compl_key2dir(int c)
4970 { 4973 {
4971 if (c == Ctrl_P || c == Ctrl_L 4974 if (c == Ctrl_P || c == Ctrl_L
4972 || (pum_visible() && (c == K_PAGEUP || c == K_KPAGEUP 4975 || c == K_PAGEUP || c == K_KPAGEUP || c == K_S_UP || c == K_UP)
4973 || c == K_S_UP || c == K_UP)))
4974 return BACKWARD; 4976 return BACKWARD;
4975 return FORWARD; 4977 return FORWARD;
4976 } 4978 }
4977 4979
4978 /* 4980 /*