Merge #4697 'capture() function'.

This commit is contained in:
Justin M. Keyes
2016-06-20 00:39:46 -04:00
6 changed files with 158 additions and 6 deletions

View File

@@ -2392,6 +2392,19 @@ static void redir_write(char_u *str, int maxlen)
char_u *s = str;
static int cur_col = 0;
if (maxlen == 0) {
return;
}
// Append output to capture().
if (capture_ga) {
size_t len = 0;
while (str[len] && (maxlen < 0 ? 1 : (len < (size_t)maxlen))) {
len++;
}
ga_concat_len(capture_ga, (const char *)str, len);
}
/* Don't do anything for displaying prompts and the like. */
if (redir_off)
return;