}
static void
-display_right_buffer(struct rdline *rdl)
+display_right_buffer(struct rdline *rdl, int force)
{
unsigned int i;
char tmp;
- if (CIRBUF_IS_EMPTY(&rdl->right))
+ if (!force && CIRBUF_IS_EMPTY(&rdl->right))
return;
rdline_puts(rdl, vt100_clear_right);
CIRBUF_FOREACH(&rdl->right, i, tmp) {
rdl->write_char(rdl, tmp);
}
- rdline_miniprintf(rdl, vt100_multi_left,
- CIRBUF_GET_LEN(&rdl->right));
+ if (!CIRBUF_IS_EMPTY(&rdl->right))
+ rdline_miniprintf(rdl, vt100_multi_left,
+ CIRBUF_GET_LEN(&rdl->right));
}
void
CIRBUF_FOREACH(&rdl->left, i, tmp) {
rdl->write_char(rdl, tmp);
}
- display_right_buffer(rdl);
+ display_right_buffer(rdl, 1);
}
int
case CMDLINE_KEY_BKSPACE:
if(!cirbuf_del_tail_safe(&rdl->left)) {
rdline_puts(rdl, vt100_bs);
- display_right_buffer(rdl);
+ display_right_buffer(rdl, 1);
}
break;
rdline_puts(rdl, vt100_bs);
cirbuf_del_tail(&rdl->left);
}
- display_right_buffer(rdl);
+ display_right_buffer(rdl, 1);
break;
case CMDLINE_KEY_SUPPR:
return RDLINE_RES_EOF;
}
if (!cirbuf_del_head_safe(&rdl->right)) {
- display_right_buffer(rdl);
+ display_right_buffer(rdl, 1);
}
break;
rdl->write_char(rdl, rdl->kill_buf[i]);
i++;
}
- display_right_buffer(rdl);
+ display_right_buffer(rdl, 0);
break;
#endif /* !NO_RDLINE_KILL_BUF */
rdl->write_char(rdl, tmp_buf[i]);
i++;
}
- display_right_buffer(rdl);
+ display_right_buffer(rdl, 1);
return RDLINE_RES_COMPLETE; /* ?? */
}
return RDLINE_RES_SUCCESS;
rdl->write_char(rdl, c);
- display_right_buffer(rdl);
+ display_right_buffer(rdl, 0);
return RDLINE_RES_SUCCESS;
}