Last active
July 19, 2016 00:53
-
-
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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