1
0
mirror of https://github.com/irssi/irssi.git synced 2024-09-29 04:45:57 -04:00

Spaces at the start of line confused the completion some.

git-svn-id: http://svn.irssi.org/repos/irssi/trunk@1144 dbcabf3a-b0e7-0310-adc4-f8d773084564
This commit is contained in:
Timo Sirainen 2001-01-28 03:04:44 +00:00 committed by cras
parent 4cbabe2a83
commit 00492856da

View File

@ -140,7 +140,14 @@ char *word_complete(WINDOW_REC *window, const char *line, int *pos)
wordlen = strlen(word);
/* get the start of line until the word we're completing */
while (wordstart > line && isseparator(wordstart[-1])) wordstart--;
if (isseparator(*line)) {
/* empty space at the start of line */
if (wordstart == line)
wordstart += strlen(wordstart);
} else {
while (wordstart > line && isseparator(wordstart[-1]))
wordstart--;
}
linestart = g_strndup(line, (int) (wordstart-line));
/* completions usually add space after the word, that makes
@ -160,7 +167,7 @@ char *word_complete(WINDOW_REC *window, const char *line, int *pos)
g_free(word);
word = g_strdup("");
startpos = strlen(linestart)+1;/*(int) (wordstart-line)+wordlen+1*/;
startpos = strlen(linestart)+1;
wordlen = 0;
}