From 2c4f0d593da344095bed55f6b5b4d3c0fd5eef51 Mon Sep 17 00:00:00 2001 From: Jfreegman Date: Sat, 14 Jun 2014 14:09:20 -0400 Subject: [PATCH] fix len values --- src/line_info.c | 9 +++++++++ src/line_info.h | 2 +- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/src/line_info.c b/src/line_info.c index 98774b6..b79b61c 100644 --- a/src/line_info.c +++ b/src/line_info.c @@ -126,6 +126,7 @@ static struct line_info *line_info_ret_queue(struct history *hst) return ret; } +/* creates new line_info line and puts it in the queue */ void line_info_add(ToxWindow *self, uint8_t *tmstmp, uint8_t *name1, uint8_t *name2, uint8_t *msg, uint8_t type, uint8_t bold, uint8_t colour) { @@ -145,9 +146,17 @@ void line_info_add(ToxWindow *self, uint8_t *tmstmp, uint8_t *name1, uint8_t *na /* for type-specific formatting in print function */ switch (type) { case ACTION: + case CONNECTION: len += 3; break; + case SYS_MSG: + break; + + case PROMPT: + ++len; + break; + default: len += 2; break; diff --git a/src/line_info.h b/src/line_info.h index 84b0eba..b04f7cc 100644 --- a/src/line_info.h +++ b/src/line_info.h @@ -67,7 +67,7 @@ struct history { int queue_sz; }; -/* adds a line to history (also moves line_start and/or line_root forward if necessary) */ +/* creates new line_info line and puts it in the queue */ void line_info_add(ToxWindow *self, uint8_t *tmstmp, uint8_t *name1, uint8_t *name2, uint8_t *msg, uint8_t type, uint8_t bold, uint8_t colour);