Hi Olivier!
The problem is, hitting backspace changes the leader and on the next
invocation of ins_complete() compl_curr_match() will be set wrongly
because ins_compl_next is called.
This patch should work better:
diff --git a/src/edit.c b/src/edit.c
--- a/src/edit.c
+++ b/src/edit.c
@@ -93,6 +93,7 @@
static compl_T *compl_first_match = NULL;
static compl_T *compl_curr_match = NULL;
static compl_T *compl_shown_match = NULL;
+static int did_bs = FALSE;
/* After using a cursor key <Enter> selects a match in the popup menu,
* otherwise it inserts a line break. */
@@ -3380,6 +3381,7 @@
if (compl_leader != NULL)
{
ins_compl_new_leader();
+ did_bs = TRUE;
return NUL;
}
return K_BS;
@@ -5363,7 +5365,10 @@
* Find next match (and following matches).
*/
save_w_wrow = curwin->w_wrow;
- n = ins_compl_next(TRUE, ins_compl_key2count(c), ins_compl_use_match(c));
+ /* don't add completions, after hitting backspace and the leader changed */
+ if (!did_bs)
+ n = ins_compl_next(TRUE, ins_compl_key2count(c), ins_compl_use_match(c));
+ did_bs = FALSE;
/* may undisplay the popup menu */
ins_compl_upd_pum();
Mit freundlichen Gr��en
Christian
--
Was man erfindet, tut man mit Liebe, was man gelernt hat, mit
Sicherheit.
-- Goethe, Maximen und Reflektionen, Nr. 1068