diff options
author | zeertzjq <zeertzjq@outlook.com> | 2023-12-04 20:29:51 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-12-04 20:29:51 +0800 |
commit | 66f1563c7a48d76f99c89e32de030e57af2abfb4 (patch) | |
tree | e3c0966099e6cb2f3a631bca17259cc1d394d3fa /src/nvim/channel.c | |
parent | cf612c64b0fc87c399bc5c72735335c5e73d6de1 (diff) | |
download | rneovim-66f1563c7a48d76f99c89e32de030e57af2abfb4.tar.gz rneovim-66f1563c7a48d76f99c89e32de030e57af2abfb4.tar.bz2 rneovim-66f1563c7a48d76f99c89e32de030e57af2abfb4.zip |
refactor(terminal): only remove const qualifier when necessary (#26386)
Diffstat (limited to 'src/nvim/channel.c')
-rw-r--r-- | src/nvim/channel.c | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/src/nvim/channel.c b/src/nvim/channel.c index 24793bcb2a..767c8d29b8 100644 --- a/src/nvim/channel.c +++ b/src/nvim/channel.c @@ -794,19 +794,20 @@ static void channel_callback_call(Channel *chan, CallbackReader *reader) /// and `buf` is assumed to be a new, unmodified buffer. void channel_terminal_open(buf_T *buf, Channel *chan) { - TerminalOptions topts; - topts.data = chan; - topts.width = chan->stream.pty.width; - topts.height = chan->stream.pty.height; - topts.write_cb = term_write; - topts.resize_cb = term_resize; - topts.close_cb = term_close; + TerminalOptions topts = { + .data = chan, + .width = chan->stream.pty.width, + .height = chan->stream.pty.height, + .write_cb = term_write, + .resize_cb = term_resize, + .close_cb = term_close, + }; buf->b_p_channel = (OptInt)chan->id; // 'channel' option channel_incref(chan); terminal_open(&chan->term, buf, topts); } -static void term_write(char *buf, size_t size, void *data) +static void term_write(const char *buf, size_t size, void *data) { Channel *chan = data; if (chan->stream.proc.in.closed) { |