&state->encoding[state->gr_set];
(*encoding->enc->decode)(encoding->enc, encoding->data,
- codepoints, &npoints, state->gsingle_set ? 1 : len,
+ codepoints, &npoints, state->gsingle_set ? 1 : (int)len,
bytes, &eaten, len);
/* There's a chance an encoding (e.g. UTF-8) hasn't found enough bytes yet
#endif
vterm_allocator_free(state->vt, codepoints);
- return eaten;
+ return (int)eaten;
}
static int on_control(unsigned char control, void *user)
state->lineinfo = vterm_allocator_malloc(state->vt, state->rows * sizeof(VTermLineInfo));
state->encoding_utf8.enc = vterm_lookup_encoding(ENC_UTF8, 'u');
- if(*state->encoding_utf8.enc->init)
+ if(*state->encoding_utf8.enc->init != NULL)
(*state->encoding_utf8.enc->init)(state->encoding_utf8.enc, state->encoding_utf8.data);
vterm_parser_set_callbacks(vt, &parser_callbacks, state);
* TODO:
* - include functions from #1871
* - do not store terminal buffer in viminfo. Or prefix term:// ?
+ * - Make CTRL-W . send CTRL-W to terminal?
* - Add a scrollback buffer (contains lines to scroll off the top).
* Can use the buf_T lines, store attributes somewhere else?
* - When the job ends:
{
int i;
size_t len = STRLEN(cmd) + 10;
- char_u *p = alloc(len);
+ char_u *p = alloc((int)len);
for (i = 1; p != NULL; ++i)
{
{
if (*p == NL)
break;
- p += utf_ptr2len_len(p, len - (p - msg));
+ p += utf_ptr2len_len(p, (int)(len - (p - msg)));
}
len_now = p - msg - done;
vterm_input_write(vterm, (char *)msg + done, len_now);
vterm_keyboard_unichar(vterm, c, mod);
/* Read back the converted escape sequence. */
- return vterm_output_read(vterm, buf, KEY_BUF_LEN);
+ return (int)vterm_output_read(vterm, buf, KEY_BUF_LEN);
}
/*
if (len > 0)
/* TODO: if FAIL is returned, stop? */
channel_send(curbuf->b_term->tl_job->jv_channel, PART_IN,
- (char_u *)buf, len, NULL);
+ (char_u *)buf, (int)len, NULL);
}
}
else
txt = (char_u *)_("finished");
len = 9 + STRLEN(term->tl_buffer->b_fname) + STRLEN(txt);
- term->tl_status_text = alloc(len);
+ term->tl_status_text = alloc((int)len);
if (term->tl_status_text != NULL)
vim_snprintf((char *)term->tl_status_text, len, "%s [%s]",
term->tl_buffer->b_fname, txt);