Skip to content

Instantly share code, notes, and snippets.

@Shougo
Last active August 29, 2015 14:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Shougo/1a7d7a53a7c56ca48a85 to your computer and use it in GitHub Desktop.
Save Shougo/1a7d7a53a7c56ca48a85 to your computer and use it in GitHub Desktop.
diff -r 36bb83cc6202 src/edit.c
--- a/src/edit.c Sat Nov 15 08:13:55 2014 +0900
+++ b/src/edit.c Sat Nov 15 08:46:02 2014 +0900
@@ -2505,6 +2505,10 @@
return FAIL;
if (len < 0)
len = (int)STRLEN(str);
+ if (compl_first_match != NULL
+ && STRNCMP(compl_first_match->cp_str, str, len) == 0
+ && compl_first_match->cp_str[len] == NUL)
+ return FAIL;
/*
* If the same match is already present, don't add it.
@@ -2611,6 +2615,8 @@
char_u *str;
int len;
{
+ if (STRLEN(match->cp_str) <= (size_t)len)
+ return FALSE;
if (match->cp_icase)
return STRNICMP(match->cp_str, str, (size_t)len) == 0;
return STRNCMP(match->cp_str, str, (size_t)len) == 0;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment