0
0
mirror of https://github.com/vim/vim.git synced 2025-09-23 03:43:49 -04:00

updated for version 7.0-023

This commit is contained in:
Bram Moolenaar
2006-06-22 15:13:21 +00:00
parent 20ff79237a
commit be46a1eba6
2 changed files with 43 additions and 17 deletions

View File

@@ -719,9 +719,14 @@ edit(cmdchar, startln, count)
#ifdef FEAT_INS_EXPAND #ifdef FEAT_INS_EXPAND
/* /*
* Special handling of keys while the popup menu is visible or wanted * Special handling of keys while the popup menu is visible or wanted
* and the cursor is still in the completed word. * and the cursor is still in the completed word. Only when there is
* a match, skip this when no matches were found.
*/ */
if (compl_started && pum_wanted() && curwin->w_cursor.col >= compl_col) if (compl_started
&& pum_wanted()
&& curwin->w_cursor.col >= compl_col
&& (compl_shown_match == NULL
|| compl_shown_match != compl_shown_match->cp_next))
{ {
/* BS: Delete one character from "compl_leader". */ /* BS: Delete one character from "compl_leader". */
if ((c == K_BS || c == Ctrl_H) if ((c == K_BS || c == Ctrl_H)
@@ -3393,8 +3398,11 @@ ins_compl_prep(c)
ptr = compl_leader; ptr = compl_leader;
else else
ptr = compl_orig_text; ptr = compl_orig_text;
if (compl_orig_text != NULL)
{
p = compl_orig_text; p = compl_orig_text;
for (temp = 0; p[temp] != NUL && p[temp] == ptr[temp]; ++temp) for (temp = 0; p[temp] != NUL && p[temp] == ptr[temp];
++temp)
; ;
#ifdef FEAT_MBYTE #ifdef FEAT_MBYTE
if (temp > 0) if (temp > 0)
@@ -3402,6 +3410,8 @@ ins_compl_prep(c)
#endif #endif
for (p += temp; *p != NUL; mb_ptr_adv(p)) for (p += temp; *p != NUL; mb_ptr_adv(p))
AppendCharToRedobuff(K_BS); AppendCharToRedobuff(K_BS);
}
if (ptr != NULL)
AppendToRedobuffLit(ptr + temp, -1); AppendToRedobuffLit(ptr + temp, -1);
} }
@@ -4650,11 +4660,19 @@ ins_complete(c)
(int)STRLEN(compl_pattern), curs_col); (int)STRLEN(compl_pattern), curs_col);
if (compl_xp.xp_context == EXPAND_UNSUCCESSFUL if (compl_xp.xp_context == EXPAND_UNSUCCESSFUL
|| compl_xp.xp_context == EXPAND_NOTHING) || compl_xp.xp_context == EXPAND_NOTHING)
return FAIL; {
compl_col = curs_col;
compl_length = 0;
vim_free(compl_pattern);
compl_pattern = NULL;
}
else
{
startcol = (int)(compl_xp.xp_pattern - compl_pattern); startcol = (int)(compl_xp.xp_pattern - compl_pattern);
compl_col = startcol; compl_col = startcol;
compl_length = curs_col - startcol; compl_length = curs_col - startcol;
} }
}
else if (ctrl_x_mode == CTRL_X_FUNCTION || ctrl_x_mode == CTRL_X_OMNI) else if (ctrl_x_mode == CTRL_X_FUNCTION || ctrl_x_mode == CTRL_X_OMNI)
{ {
#ifdef FEAT_COMPL_FUNC #ifdef FEAT_COMPL_FUNC
@@ -4707,11 +4725,17 @@ ins_complete(c)
else else
compl_col = spell_word_start(startcol); compl_col = spell_word_start(startcol);
if (compl_col >= (colnr_T)startcol) if (compl_col >= (colnr_T)startcol)
return FAIL; {
compl_length = 0;
compl_col = curs_col;
}
else
{
spell_expand_check_cap(compl_col); spell_expand_check_cap(compl_col);
compl_length = (int)curs_col - compl_col;
}
/* Need to obtain "line" again, it may have become invalid. */ /* Need to obtain "line" again, it may have become invalid. */
line = ml_get(curwin->w_cursor.lnum); line = ml_get(curwin->w_cursor.lnum);
compl_length = (int)curs_col - compl_col;
compl_pattern = vim_strnsave(line + compl_col, compl_length); compl_pattern = vim_strnsave(line + compl_col, compl_length);
if (compl_pattern == NULL) if (compl_pattern == NULL)
#endif #endif

View File

@@ -666,6 +666,8 @@ static char *(features[]) =
static int included_patches[] = static int included_patches[] =
{ /* Add new patch number below this line */ { /* Add new patch number below this line */
/**/
23,
/**/ /**/
22, 22,
/**/ /**/