int offset = utf8_index(sb_str(current->buf), pos);
int nbytes = utf8_index(sb_str(current->buf) + offset, nchars);
- if (nbytes) {
+ if (nbytes > 0) {
if (current->capture) {
sb_clear(current->capture);
}
int linenoiseColumns(void)
{
struct current current;
+ current.output = NULL;
enableRawMode (¤t);
getWindowSize (¤t);
disableRawMode (¤t);