Skip to content

Instantly share code, notes, and snippets.

@Juerd
Last active July 19, 2016 00:53
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 Juerd/217697f68b6b32340024d7cb63249e3d to your computer and use it in GitHub Desktop.
Save Juerd/217697f68b6b32340024d7cb63249e3d to your computer and use it in GitHub Desktop.
Let irssi tab completion consider current word up to cursor instead of up to separator. Ugly hack.
diff --git a/src/fe-common/core/completion.c b/src/fe-common/core/completion.c
index 46fd9db..0decb4f 100644
--- a/src/fe-common/core/completion.c
+++ b/src/fe-common/core/completion.c
@@ -80,6 +80,7 @@ static char *get_word_at(const char *str, int pos, char **startpos)
while (start > str && !isseparator(start[-1])) start--;
while (*end != '\0' && !isseparator(*end)) end++;
while (*end != '\0' && isseparator_notspace(*end)) end++;
+ if (end > str+pos) end = str+pos;
*startpos = (char *) start;
return g_strndup(start, (int) (end-start));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment