A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/neovim/neovim/commit/7813b48645bf2af11c2d18f4e4154a74d4dad662 below:

use vterm_output_set_callback() · neovim/neovim@7813b48 · GitHub

File tree Expand file treeCollapse file tree 2 files changed

+6

-15

lines changed

Filter options

Expand file treeCollapse file tree 2 files changed

+6

-15

lines changed Original file line number Diff line number Diff line change

@@ -613,7 +613,6 @@ static void on_channel_output(Stream *stream, Channel *chan, RBuffer *buf, size_

613 613

} else {

614 614

if (chan->term) {

615 615

terminal_receive(chan->term, ptr, count);

616 -

terminal_flush_output(chan->term);

617 616

}

618 617 619 618

rbuffer_consumed(buf, count);

Original file line number Diff line number Diff line change

@@ -172,6 +172,11 @@ void terminal_teardown(void)

172 172

pmap_init(ptr_t, &invalidated_terminals);

173 173

}

174 174 175 +

static void term_output_callback(const char *s, size_t len, void *user_data)

176 +

{

177 +

terminal_send((Terminal *)user_data, (char *)s, len);

178 +

}

179 + 175 180

// public API {{{

176 181 177 182

Terminal *terminal_open(buf_T *buf, TerminalOptions opts)

@@ -195,6 +200,7 @@ Terminal *terminal_open(buf_T *buf, TerminalOptions opts)

195 200

vterm_screen_set_callbacks(rv->vts, &vterm_screen_callbacks, rv);

196 201

vterm_screen_set_damage_merge(rv->vts, VTERM_DAMAGE_SCROLL);

197 202

vterm_screen_reset(rv->vts, 1);

203 +

vterm_output_set_callback(rv->vt, term_output_callback, rv);

198 204

// force a initial refresh of the screen to ensure the buffer will always

199 205

// have as many lines as screen rows when refresh_scrollback is called

200 206

rv->invalid_start = 0;

@@ -636,7 +642,6 @@ void terminal_paste(long count, char_u **y_array, size_t y_size)

636 642

return;

637 643

}

638 644

vterm_keyboard_start_paste(curbuf->terminal->vt);

639 -

terminal_flush_output(curbuf->terminal);

640 645

size_t buff_len = STRLEN(y_array[0]);

641 646

char_u *buff = xmalloc(buff_len);

642 647

for (int i = 0; i < count; i++) { // -V756

@@ -667,14 +672,6 @@ void terminal_paste(long count, char_u **y_array, size_t y_size)

667 672

}

668 673

xfree(buff);

669 674

vterm_keyboard_end_paste(curbuf->terminal->vt);

670 -

terminal_flush_output(curbuf->terminal);

671 -

}

672 - 673 -

void terminal_flush_output(Terminal *term)

674 -

{

675 -

size_t len = vterm_output_read(term->vt, term->textbuf,

676 -

sizeof(term->textbuf));

677 -

terminal_send(term, term->textbuf, len);

678 675

}

679 676 680 677

void terminal_send_key(Terminal *term, int c)

@@ -693,8 +690,6 @@ void terminal_send_key(Terminal *term, int c)

693 690

} else {

694 691

vterm_keyboard_unichar(term->vt, (uint32_t)c, mod);

695 692

}

696 - 697 -

terminal_flush_output(term);

698 693

}

699 694 700 695

void terminal_receive(Terminal *term, char *data, size_t len)

@@ -1265,9 +1260,6 @@ static bool send_mouse_event(Terminal *term, int c)

1265 1260

}

1266 1261 1267 1262

mouse_action(term, button, row, col - offset, pressed, 0);

1268 -

size_t len = vterm_output_read(term->vt, term->textbuf,

1269 -

sizeof(term->textbuf));

1270 -

terminal_send(term, term->textbuf, len);

1271 1263

return false;

1272 1264

}

1273 1265

You can’t perform that action at this time.


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4