mirror of
https://github.com/neovim/neovim.git
synced 2025-02-25 18:55:25 -06:00
Merge pull request #14486 from Sh3Rm4n/fix_get_str_line
get_str_line: Replace grow_array usage
This commit is contained in:
commit
c2624b87cb
@ -2720,12 +2720,9 @@ static char_u *get_str_line(int c, void *cookie, int indent, bool do_concat)
|
|||||||
i++;
|
i++;
|
||||||
}
|
}
|
||||||
size_t line_length = i - p->offset;
|
size_t line_length = i - p->offset;
|
||||||
garray_T ga;
|
char_u *buf = xmemdupz(p->buf + p->offset, line_length);
|
||||||
ga_init(&ga, (int)sizeof(char_u), (int)line_length);
|
|
||||||
ga_concat_len(&ga, (char *)p->buf + p->offset, line_length);
|
|
||||||
ga_append(&ga, '\0');
|
|
||||||
p->offset = i + 1;
|
p->offset = i + 1;
|
||||||
return ga.ga_data;
|
return buf;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int source_using_linegetter(void *cookie,
|
static int source_using_linegetter(void *cookie,
|
||||||
|
Loading…
Reference in New Issue
Block a user