mirror of
https://github.com/neovim/neovim.git
synced 2025-02-25 18:55:25 -06:00
Merge pull request #14455 from Sh3Rm4n/fix_get_str_line
[RDY] Fix get str line
This commit is contained in:
commit
a0da4c3a49
@ -2719,16 +2719,13 @@ static char_u *get_str_line(int c, void *cookie, int indent, bool do_concat)
|
|||||||
while (!(p->buf[i] == '\n' || p->buf[i] == '\0')) {
|
while (!(p->buf[i] == '\n' || p->buf[i] == '\0')) {
|
||||||
i++;
|
i++;
|
||||||
}
|
}
|
||||||
char buf[2046];
|
size_t line_length = i - p->offset;
|
||||||
char *dst;
|
garray_T ga;
|
||||||
dst = xstpncpy(buf, (char *)p->buf + p->offset, i - p->offset);
|
ga_init(&ga, (int)sizeof(char_u), (int)line_length);
|
||||||
if ((uint32_t)(dst - buf) != i - p->offset) {
|
ga_concat_len(&ga, (char *)p->buf + p->offset, line_length);
|
||||||
smsg(_(":source error parsing command %s"), p->buf);
|
ga_append(&ga, '\0');
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
buf[i - p->offset] = '\0';
|
|
||||||
p->offset = i + 1;
|
p->offset = i + 1;
|
||||||
return (char_u *)xstrdup(buf);
|
return ga.ga_data;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int source_using_linegetter(void *cookie,
|
static int source_using_linegetter(void *cookie,
|
||||||
|
@ -2265,12 +2265,14 @@ void msg_scroll_up(bool may_throttle)
|
|||||||
/// per screen update.
|
/// per screen update.
|
||||||
///
|
///
|
||||||
/// NB: The bookkeeping is quite messy, and rests on a bunch of poorly
|
/// NB: The bookkeeping is quite messy, and rests on a bunch of poorly
|
||||||
/// documented assumtions. For instance that the message area always grows while
|
/// documented assumptions. For instance that the message area always grows
|
||||||
/// being throttled, messages are only being output on the last line etc.
|
/// while being throttled, messages are only being output on the last line
|
||||||
|
/// etc.
|
||||||
///
|
///
|
||||||
/// Probably message scrollback storage should reimplented as a file_buffer, and
|
/// Probably message scrollback storage should be reimplemented as a
|
||||||
/// message scrolling in TUI be reimplemented as a modal floating window. Then
|
/// file_buffer, and message scrolling in TUI be reimplemented as a modal
|
||||||
/// we get throttling "for free" using standard redraw_later code paths.
|
/// floating window. Then we get throttling "for free" using standard
|
||||||
|
/// redraw_later code paths.
|
||||||
void msg_scroll_flush(void)
|
void msg_scroll_flush(void)
|
||||||
{
|
{
|
||||||
if (msg_grid.throttled) {
|
if (msg_grid.throttled) {
|
||||||
|
Loading…
Reference in New Issue
Block a user