Mercurial > vim
comparison src/edit.c @ 665:21ab9abf0f08
updated for version 7.0196
author | vimboss |
---|---|
date | Fri, 10 Feb 2006 23:20:28 +0000 |
parents | e93a99ef31d0 |
children | 9090f866cd57 |
comparison
equal
deleted
inserted
replaced
664:ce5a759cc907 | 665:21ab9abf0f08 |
---|---|
93 | 93 |
94 /* When "compl_leader" is not NULL only matches that start with this string | 94 /* When "compl_leader" is not NULL only matches that start with this string |
95 * are used. */ | 95 * are used. */ |
96 static char_u *compl_leader = NULL; | 96 static char_u *compl_leader = NULL; |
97 | 97 |
98 static int compl_get_longest = FALSE; /* put longest common string | |
99 in compl_leader */ | |
100 | |
98 static int compl_used_match; /* Selected one of the matches. When | 101 static int compl_used_match; /* Selected one of the matches. When |
99 FALSE the match was edited or using | 102 FALSE the match was edited or using |
100 the longest common string. */ | 103 the longest common string. */ |
101 | 104 |
102 /* When the first completion is done "compl_started" is set. When it's | 105 /* When the first completion is done "compl_started" is set. When it's |
117 static int compl_cont_mode = 0; | 120 static int compl_cont_mode = 0; |
118 static expand_T compl_xp; | 121 static expand_T compl_xp; |
119 | 122 |
120 static void ins_ctrl_x __ARGS((void)); | 123 static void ins_ctrl_x __ARGS((void)); |
121 static int has_compl_option __ARGS((int dict_opt)); | 124 static int has_compl_option __ARGS((int dict_opt)); |
125 static void ins_compl_longest_match __ARGS((compl_T *match)); | |
122 static void ins_compl_add_matches __ARGS((int num_matches, char_u **matches)); | 126 static void ins_compl_add_matches __ARGS((int num_matches, char_u **matches)); |
123 static int ins_compl_make_cyclic __ARGS((void)); | 127 static int ins_compl_make_cyclic __ARGS((void)); |
124 static void ins_compl_upd_pum __ARGS((void)); | 128 static void ins_compl_upd_pum __ARGS((void)); |
125 static void ins_compl_del_pum __ARGS((void)); | 129 static void ins_compl_del_pum __ARGS((void)); |
126 static int pum_wanted __ARGS((void)); | 130 static int pum_wanted __ARGS((void)); |
134 static int ins_compl_prep __ARGS((int c)); | 138 static int ins_compl_prep __ARGS((int c)); |
135 static buf_T *ins_compl_next_buf __ARGS((buf_T *buf, int flag)); | 139 static buf_T *ins_compl_next_buf __ARGS((buf_T *buf, int flag)); |
136 static int ins_compl_get_exp __ARGS((pos_T *ini)); | 140 static int ins_compl_get_exp __ARGS((pos_T *ini)); |
137 static void ins_compl_delete __ARGS((void)); | 141 static void ins_compl_delete __ARGS((void)); |
138 static void ins_compl_insert __ARGS((void)); | 142 static void ins_compl_insert __ARGS((void)); |
139 static int ins_compl_next __ARGS((int allow_get_expansion, int count)); | 143 static int ins_compl_next __ARGS((int allow_get_expansion, int count, int insert_match)); |
140 static int ins_compl_key2dir __ARGS((int c)); | 144 static int ins_compl_key2dir __ARGS((int c)); |
141 static int ins_compl_pum_key __ARGS((int c)); | 145 static int ins_compl_pum_key __ARGS((int c)); |
142 static int ins_compl_key2count __ARGS((int c)); | 146 static int ins_compl_key2count __ARGS((int c)); |
143 static int ins_complete __ARGS((int c)); | 147 static int ins_complete __ARGS((int c)); |
144 static int quote_meta __ARGS((char_u *dest, char_u *str, int len)); | 148 static int quote_meta __ARGS((char_u *dest, char_u *str, int len)); |
681 if (p_fkmap && KeyTyped) | 685 if (p_fkmap && KeyTyped) |
682 c = fkmap(c); /* Farsi mode mapping */ | 686 c = fkmap(c); /* Farsi mode mapping */ |
683 #endif | 687 #endif |
684 | 688 |
685 #ifdef FEAT_INS_EXPAND | 689 #ifdef FEAT_INS_EXPAND |
686 /* When the popup menu is visible cursor keys change the selection. */ | |
687 if (c == K_UP && pum_visible()) | |
688 c = Ctrl_P; | |
689 if (c == K_DOWN && pum_visible()) | |
690 c = Ctrl_N; | |
691 | |
692 /* | 690 /* |
693 * Special handling of keys while the popup menu is visible or wanted | 691 * Special handling of keys while the popup menu is visible or wanted |
694 * and the cursor is still in the completed word. | 692 * and the cursor is still in the completed word. |
695 */ | 693 */ |
696 if (compl_started && pum_wanted() && curwin->w_cursor.col >= compl_col) | 694 if (compl_started && pum_wanted() && curwin->w_cursor.col >= compl_col) |
715 if (vim_isprintc(c)) | 713 if (vim_isprintc(c)) |
716 { | 714 { |
717 ins_compl_addleader(c); | 715 ins_compl_addleader(c); |
718 continue; | 716 continue; |
719 } | 717 } |
718 | |
719 /* Pressing Enter selects the current match. */ | |
720 if (c == CAR || c == K_KENTER || c == NL) | |
721 { | |
722 ins_compl_delete(); | |
723 ins_compl_insert(); | |
724 } | |
720 } | 725 } |
721 } | 726 } |
722 | 727 |
723 /* Prepare for or stop CTRL-X mode. This doesn't do completion, but | 728 /* Prepare for or stop CTRL-X mode. This doesn't do completion, but |
724 * it does fix up the text when finishing completion. */ | 729 * it does fix up the text when finishing completion. */ |
730 compl_get_longest = FALSE; | |
725 if (c != K_IGNORE && ins_compl_prep(c)) | 731 if (c != K_IGNORE && ins_compl_prep(c)) |
726 continue; | 732 continue; |
727 #endif | 733 #endif |
728 | 734 |
729 /* CTRL-\ CTRL-N goes to Normal mode, | 735 /* CTRL-\ CTRL-N goes to Normal mode, |
1101 case K_C_RIGHT: | 1107 case K_C_RIGHT: |
1102 ins_s_right(); | 1108 ins_s_right(); |
1103 break; | 1109 break; |
1104 | 1110 |
1105 case K_UP: /* <Up> */ | 1111 case K_UP: /* <Up> */ |
1112 #ifdef FEAT_INS_EXPAND | |
1113 if (pum_visible()) | |
1114 goto docomplete; | |
1115 #endif | |
1106 if (mod_mask & MOD_MASK_SHIFT) | 1116 if (mod_mask & MOD_MASK_SHIFT) |
1107 ins_pageup(); | 1117 ins_pageup(); |
1108 else | 1118 else |
1109 ins_up(FALSE); | 1119 ins_up(FALSE); |
1110 break; | 1120 break; |
1118 #endif | 1128 #endif |
1119 ins_pageup(); | 1129 ins_pageup(); |
1120 break; | 1130 break; |
1121 | 1131 |
1122 case K_DOWN: /* <Down> */ | 1132 case K_DOWN: /* <Down> */ |
1133 #ifdef FEAT_INS_EXPAND | |
1134 if (pum_visible()) | |
1135 goto docomplete; | |
1136 #endif | |
1123 if (mod_mask & MOD_MASK_SHIFT) | 1137 if (mod_mask & MOD_MASK_SHIFT) |
1124 ins_pagedown(); | 1138 ins_pagedown(); |
1125 else | 1139 else |
1126 ins_down(FALSE); | 1140 ins_down(FALSE); |
1127 break; | 1141 break; |
1858 if (ctrl_x_mode != CTRL_X_CMDLINE) | 1872 if (ctrl_x_mode != CTRL_X_CMDLINE) |
1859 { | 1873 { |
1860 /* if the next ^X<> won't ADD nothing, then reset | 1874 /* if the next ^X<> won't ADD nothing, then reset |
1861 * compl_cont_status */ | 1875 * compl_cont_status */ |
1862 if (compl_cont_status & CONT_N_ADDS) | 1876 if (compl_cont_status & CONT_N_ADDS) |
1863 compl_cont_status = (compl_cont_status | CONT_INTRPT); | 1877 compl_cont_status |= CONT_INTRPT; |
1864 else | 1878 else |
1865 compl_cont_status = 0; | 1879 compl_cont_status = 0; |
1866 /* We're not sure which CTRL-X mode it will be yet */ | 1880 /* We're not sure which CTRL-X mode it will be yet */ |
1867 ctrl_x_mode = CTRL_X_NOT_DEFINED_YET; | 1881 ctrl_x_mode = CTRL_X_NOT_DEFINED_YET; |
1868 edit_submode = (char_u *)_(CTRL_X_MSG(ctrl_x_mode)); | 1882 edit_submode = (char_u *)_(CTRL_X_MSG(ctrl_x_mode)); |
2136 match->cp_prev->cp_next = match; | 2150 match->cp_prev->cp_next = match; |
2137 else /* if there's nothing before, it is the first match */ | 2151 else /* if there's nothing before, it is the first match */ |
2138 compl_first_match = match; | 2152 compl_first_match = match; |
2139 compl_curr_match = match; | 2153 compl_curr_match = match; |
2140 | 2154 |
2155 /* | |
2156 * Find the longest common string if still doing that. | |
2157 */ | |
2158 if (compl_get_longest && (flags & ORIGINAL_TEXT) == 0) | |
2159 ins_compl_longest_match(match); | |
2160 | |
2141 return OK; | 2161 return OK; |
2162 } | |
2163 | |
2164 /* | |
2165 * Reduce the longest common string for match "match". | |
2166 */ | |
2167 static void | |
2168 ins_compl_longest_match(match) | |
2169 compl_T *match; | |
2170 { | |
2171 char_u *p, *s; | |
2172 int l; | |
2173 int had_match; | |
2174 | |
2175 if (compl_leader == NULL) | |
2176 /* First match, use it as a whole. */ | |
2177 compl_leader = vim_strsave(match->cp_str); | |
2178 else | |
2179 { | |
2180 /* Reduce the text if this match differs from compl_leader. */ | |
2181 for (p = compl_leader, s = match->cp_str; *p != NUL; p += l, s += l) | |
2182 { | |
2183 #ifdef FEAT_MBYTE | |
2184 if (has_mbyte) | |
2185 { | |
2186 l = mb_ptr2len(p); | |
2187 if (STRNCMP(p, s, l) != 0) | |
2188 break; | |
2189 } | |
2190 else | |
2191 #endif | |
2192 { | |
2193 if (*p != *s) | |
2194 break; | |
2195 l = 1; | |
2196 } | |
2197 } | |
2198 | |
2199 if (*p != NUL) | |
2200 { | |
2201 /* Leader was shortened, need to change the inserted text. */ | |
2202 *p = NUL; | |
2203 had_match = (curwin->w_cursor.col > compl_col); | |
2204 ins_compl_delete(); | |
2205 ins_bytes(compl_leader + curwin->w_cursor.col - compl_col); | |
2206 ins_redraw(FALSE); | |
2207 | |
2208 /* When the match isn't there (to avoid matching itself) remove it | |
2209 * again after redrawing. */ | |
2210 if (!had_match) | |
2211 ins_compl_delete(); | |
2212 } | |
2213 | |
2214 compl_used_match = FALSE; | |
2215 } | |
2142 } | 2216 } |
2143 | 2217 |
2144 /* | 2218 /* |
2145 * Add an array of matches to the list of matches. | 2219 * Add an array of matches to the list of matches. |
2146 * Frees matches[]. | 2220 * Frees matches[]. |
2229 */ | 2303 */ |
2230 static int | 2304 static int |
2231 pum_wanted() | 2305 pum_wanted() |
2232 { | 2306 { |
2233 /* 'completeopt' must contain "menu" */ | 2307 /* 'completeopt' must contain "menu" */ |
2234 if (*p_cot == NUL) | 2308 if (vim_strchr(p_cot, 'm') == NULL) |
2235 return FALSE; | 2309 return FALSE; |
2236 | 2310 |
2237 /* The display looks bad on a B&W display. */ | 2311 /* The display looks bad on a B&W display. */ |
2238 if (t_colors < 8 | 2312 if (t_colors < 8 |
2239 #ifdef FEAT_GUI | 2313 #ifdef FEAT_GUI |
2759 edit_submode_extra = NULL; | 2833 edit_submode_extra = NULL; |
2760 | 2834 |
2761 /* Ignore end of Select mode mapping */ | 2835 /* Ignore end of Select mode mapping */ |
2762 if (c == K_SELECT) | 2836 if (c == K_SELECT) |
2763 return retval; | 2837 return retval; |
2838 | |
2839 /* Set "compl_get_longest" when finding the first matches. */ | |
2840 if (ctrl_x_mode == CTRL_X_NOT_DEFINED_YET | |
2841 || (ctrl_x_mode == 0 && !compl_started)) | |
2842 { | |
2843 compl_get_longest = (vim_strchr(p_cot, 'l') != NULL); | |
2844 compl_used_match = TRUE; | |
2845 } | |
2764 | 2846 |
2765 if (ctrl_x_mode == CTRL_X_NOT_DEFINED_YET) | 2847 if (ctrl_x_mode == CTRL_X_NOT_DEFINED_YET) |
2766 { | 2848 { |
2767 /* | 2849 /* |
2768 * We have just typed CTRL-X and aren't quite sure which CTRL-X mode | 2850 * We have just typed CTRL-X and aren't quite sure which CTRL-X mode |
3354 compl_started = TRUE; | 3436 compl_started = TRUE; |
3355 first_match_pos = *pos; | 3437 first_match_pos = *pos; |
3356 last_match_pos = *pos; | 3438 last_match_pos = *pos; |
3357 } | 3439 } |
3358 else if (first_match_pos.lnum == last_match_pos.lnum | 3440 else if (first_match_pos.lnum == last_match_pos.lnum |
3359 && first_match_pos.col == last_match_pos.col) | 3441 && first_match_pos.col == last_match_pos.col) |
3360 found_new_match = FAIL; | 3442 found_new_match = FAIL; |
3361 if (found_new_match == FAIL) | 3443 if (found_new_match == FAIL) |
3362 { | 3444 { |
3363 if (ins_buf == curbuf) | 3445 if (ins_buf == curbuf) |
3364 found_all = TRUE; | 3446 found_all = TRUE; |
3468 if ((ctrl_x_mode != 0 && ctrl_x_mode != CTRL_X_WHOLE_LINE) | 3550 if ((ctrl_x_mode != 0 && ctrl_x_mode != CTRL_X_WHOLE_LINE) |
3469 || found_new_match != FAIL) | 3551 || found_new_match != FAIL) |
3470 { | 3552 { |
3471 if (got_int) | 3553 if (got_int) |
3472 break; | 3554 break; |
3555 /* Fill the popup menu as soon as possible. */ | |
3473 if (pum_wanted() && type != -1) | 3556 if (pum_wanted() && type != -1) |
3474 /* Fill the popup menu as soon as possible. */ | |
3475 ins_compl_check_keys(0); | 3557 ins_compl_check_keys(0); |
3558 | |
3476 if ((ctrl_x_mode != 0 && ctrl_x_mode != CTRL_X_WHOLE_LINE) | 3559 if ((ctrl_x_mode != 0 && ctrl_x_mode != CTRL_X_WHOLE_LINE) |
3477 || compl_interrupted) | 3560 || compl_interrupted) |
3478 break; | 3561 break; |
3479 compl_started = TRUE; | 3562 compl_started = TRUE; |
3480 } | 3563 } |
3545 * Note that this function may be called recursively once only. First with | 3628 * Note that this function may be called recursively once only. First with |
3546 * "allow_get_expansion" TRUE, which calls ins_compl_get_exp(), which in turn | 3629 * "allow_get_expansion" TRUE, which calls ins_compl_get_exp(), which in turn |
3547 * calls this function with "allow_get_expansion" FALSE. | 3630 * calls this function with "allow_get_expansion" FALSE. |
3548 */ | 3631 */ |
3549 static int | 3632 static int |
3550 ins_compl_next(allow_get_expansion, count) | 3633 ins_compl_next(allow_get_expansion, count, insert_match) |
3551 int allow_get_expansion; | 3634 int allow_get_expansion; |
3552 int count; /* repeat completion this many times; should | 3635 int count; /* repeat completion this many times; should |
3553 be at least 1 */ | 3636 be at least 1 */ |
3637 int insert_match; /* Insert the newly selected match */ | |
3554 { | 3638 { |
3555 int num_matches = -1; | 3639 int num_matches = -1; |
3556 int i; | 3640 int i; |
3557 int todo = count; | 3641 int todo = count; |
3558 compl_T *found_compl = NULL; | 3642 compl_T *found_compl = NULL; |
3559 int found_end = FALSE; | 3643 int found_end = FALSE; |
3560 | 3644 |
3561 if (allow_get_expansion) | 3645 if (compl_leader != NULL |
3562 { | 3646 && (compl_shown_match->cp_flags & ORIGINAL_TEXT) == 0) |
3647 { | |
3648 /* Set "compl_shown_match" to the actually shown match, it may differ | |
3649 * when "compl_leader" is used to omit some of the matches. */ | |
3650 while (STRNCMP(compl_shown_match->cp_str, | |
3651 compl_leader, STRLEN(compl_leader)) != 0 | |
3652 && compl_shown_match->cp_next != NULL | |
3653 && compl_shown_match->cp_next != compl_first_match) | |
3654 compl_shown_match = compl_shown_match->cp_next; | |
3655 } | |
3656 | |
3657 if (allow_get_expansion && insert_match | |
3658 && (!compl_get_longest || compl_used_match)) | |
3563 /* Delete old text to be replaced */ | 3659 /* Delete old text to be replaced */ |
3564 ins_compl_delete(); | 3660 ins_compl_delete(); |
3565 } | 3661 |
3566 compl_pending = FALSE; | 3662 compl_pending = FALSE; |
3567 | 3663 |
3568 /* Repeat this for when <PageUp> or <PageDown> is typed. But don't wrap | 3664 /* Repeat this for when <PageUp> or <PageDown> is typed. But don't wrap |
3569 * around. */ | 3665 * around. */ |
3570 while (--todo >= 0) | 3666 while (--todo >= 0) |
3613 } | 3709 } |
3614 todo = 1; /* use first usable match after wrapping around */ | 3710 todo = 1; /* use first usable match after wrapping around */ |
3615 } | 3711 } |
3616 } | 3712 } |
3617 | 3713 |
3618 /* Insert the text of the new completion */ | 3714 /* Insert the text of the new completion, or the compl_leader. */ |
3619 ins_compl_insert(); | 3715 if (insert_match) |
3716 { | |
3717 if (!compl_get_longest || compl_used_match) | |
3718 ins_compl_insert(); | |
3719 else | |
3720 ins_bytes(compl_leader + curwin->w_cursor.col - compl_col); | |
3721 } | |
3722 else | |
3723 compl_used_match = FALSE; | |
3620 | 3724 |
3621 if (!allow_get_expansion) | 3725 if (!allow_get_expansion) |
3622 { | 3726 { |
3623 /* may undisplay the popup menu first */ | 3727 /* may undisplay the popup menu first */ |
3624 ins_compl_upd_pum(); | 3728 ins_compl_upd_pum(); |
3729 | |
3730 /* redraw to show the user what was inserted */ | |
3731 update_screen(0); | |
3625 | 3732 |
3626 /* display the updated popup menu */ | 3733 /* display the updated popup menu */ |
3627 ins_compl_show_pum(); | 3734 ins_compl_show_pum(); |
3628 | 3735 |
3629 /* Delete old text to be replaced, since we're still searching and | 3736 /* Delete old text to be replaced, since we're still searching and |
3683 { | 3790 { |
3684 if (vim_is_ctrl_x_key(c) && c != Ctrl_X && c != Ctrl_R) | 3791 if (vim_is_ctrl_x_key(c) && c != Ctrl_X && c != Ctrl_R) |
3685 { | 3792 { |
3686 c = safe_vgetc(); /* Eat the character */ | 3793 c = safe_vgetc(); /* Eat the character */ |
3687 compl_shows_dir = ins_compl_key2dir(c); | 3794 compl_shows_dir = ins_compl_key2dir(c); |
3688 (void)ins_compl_next(FALSE, ins_compl_key2count(c)); | 3795 (void)ins_compl_next(FALSE, ins_compl_key2count(c), |
3796 c != K_UP && c != K_DOWN); | |
3689 } | 3797 } |
3690 else if (c != Ctrl_R) | 3798 else if (c != Ctrl_R) |
3691 compl_interrupted = TRUE; | 3799 compl_interrupted = TRUE; |
3692 } | 3800 } |
3693 if (compl_pending && !got_int) | 3801 if (compl_pending && !got_int) |
3694 (void)ins_compl_next(FALSE, 1); | 3802 (void)ins_compl_next(FALSE, 1, TRUE); |
3695 } | 3803 } |
3696 | 3804 |
3697 /* | 3805 /* |
3698 * Decide the direction of Insert mode complete from the key typed. | 3806 * Decide the direction of Insert mode complete from the key typed. |
3699 * Returns BACKWARD or FORWARD. | 3807 * Returns BACKWARD or FORWARD. |
3700 */ | 3808 */ |
3701 static int | 3809 static int |
3702 ins_compl_key2dir(c) | 3810 ins_compl_key2dir(c) |
3703 int c; | 3811 int c; |
3704 { | 3812 { |
3705 if (c == Ctrl_P || c == Ctrl_L || (pum_visible() | 3813 if (c == Ctrl_P || c == Ctrl_L |
3706 && (c == K_PAGEUP || c == K_KPAGEUP || c == K_S_UP))) | 3814 || (pum_visible() && (c == K_PAGEUP || c == K_KPAGEUP |
3815 || c == K_S_UP || c == K_UP))) | |
3707 return BACKWARD; | 3816 return BACKWARD; |
3708 return FORWARD; | 3817 return FORWARD; |
3709 } | 3818 } |
3710 | 3819 |
3711 /* | 3820 /* |
3715 static int | 3824 static int |
3716 ins_compl_pum_key(c) | 3825 ins_compl_pum_key(c) |
3717 int c; | 3826 int c; |
3718 { | 3827 { |
3719 return pum_visible() && (c == K_PAGEUP || c == K_KPAGEUP || c == K_S_UP | 3828 return pum_visible() && (c == K_PAGEUP || c == K_KPAGEUP || c == K_S_UP |
3720 || c == K_PAGEDOWN || c == K_KPAGEDOWN || c == K_S_DOWN); | 3829 || c == K_PAGEDOWN || c == K_KPAGEDOWN || c == K_S_DOWN |
3830 || c == K_UP || c == K_DOWN); | |
3721 } | 3831 } |
3722 | 3832 |
3723 /* | 3833 /* |
3724 * Decide the number of completions to move forward. | 3834 * Decide the number of completions to move forward. |
3725 * Returns 1 for most keys, height of the popup menu for page-up/down keys. | 3835 * Returns 1 for most keys, height of the popup menu for page-up/down keys. |
3728 ins_compl_key2count(c) | 3838 ins_compl_key2count(c) |
3729 int c; | 3839 int c; |
3730 { | 3840 { |
3731 int h; | 3841 int h; |
3732 | 3842 |
3733 if (ins_compl_pum_key(c)) | 3843 if (ins_compl_pum_key(c) && c != K_UP && c != K_DOWN) |
3734 { | 3844 { |
3735 h = pum_get_height(); | 3845 h = pum_get_height(); |
3736 if (h > 3) | 3846 if (h > 3) |
3737 h -= 2; /* keep some context */ | 3847 h -= 2; /* keep some context */ |
3738 return h; | 3848 return h; |
3781 * "compl_startpos" | 3891 * "compl_startpos" |
3782 * is not in the same line as the cursor then fix it (the line has | 3892 * is not in the same line as the cursor then fix it (the line has |
3783 * been split because it was longer than 'tw'). if SOL is set then | 3893 * been split because it was longer than 'tw'). if SOL is set then |
3784 * skip the previous pattern, a word at the beginning of the line has | 3894 * skip the previous pattern, a word at the beginning of the line has |
3785 * been inserted, we'll look for that -- Acevedo. */ | 3895 * been inserted, we'll look for that -- Acevedo. */ |
3786 if ((compl_cont_status & CONT_INTRPT) && compl_cont_mode == ctrl_x_mode) | 3896 if ((compl_cont_status & CONT_INTRPT) == CONT_INTRPT |
3897 && compl_cont_mode == ctrl_x_mode) | |
3787 { | 3898 { |
3788 /* | 3899 /* |
3789 * it is a continued search | 3900 * it is a continued search |
3790 */ | 3901 */ |
3791 compl_cont_status &= ~CONT_INTRPT; /* remove INTRPT */ | 3902 compl_cont_status &= ~CONT_INTRPT; /* remove INTRPT */ |
4127 | 4238 |
4128 compl_shown_match = compl_curr_match; | 4239 compl_shown_match = compl_curr_match; |
4129 compl_shows_dir = compl_direction; | 4240 compl_shows_dir = compl_direction; |
4130 | 4241 |
4131 /* | 4242 /* |
4132 * Find next match. | 4243 * Find next match (and following matches). |
4133 */ | 4244 */ |
4134 n = ins_compl_next(TRUE, ins_compl_key2count(c)); | 4245 n = ins_compl_next(TRUE, ins_compl_key2count(c), |
4246 c != K_UP && c != K_DOWN); | |
4135 | 4247 |
4136 /* may undisplay the popup menu */ | 4248 /* may undisplay the popup menu */ |
4137 ins_compl_upd_pum(); | 4249 ins_compl_upd_pum(); |
4138 | 4250 |
4139 if (n > 1) /* all matches have been found */ | 4251 if (n > 1) /* all matches have been found */ |