From: NeilBrown Date: Wed, 13 Jan 2016 05:19:25 +0000 (+1100) Subject: Fix two issues with viewing TAGS file X-Git-Tag: lca2016~18 X-Git-Url: http://git.neil.brown.name/?a=commitdiff_plain;h=a58329ecc5c71db6aacee7e468d948ae71129d13;p=edlib.git Fix two issues with viewing TAGS file 1/ DEL char wasn't handled well 2/ didn't stripe old attribute properly Signed-off-by: NeilBrown --- diff --git a/doc-text.c b/doc-text.c index 3967df4e..2e35baa6 100644 --- a/doc-text.c +++ b/doc-text.c @@ -1660,6 +1660,8 @@ DEF_CMD(render_line) buf_concat(&b, "^"); buf_append(&b, '@' + ch); buf_concat(&b, ""); + } else if (ch == 0x7f) { + buf_concat(&b, "^?"); } else buf_append(&b, ch); if (attr) diff --git a/render-lines.c b/render-lines.c index 88fa9840..bff32430 100644 --- a/render-lines.c +++ b/render-lines.c @@ -355,7 +355,7 @@ static void render_line(struct pane *p, char *line, int *yp, int dodraw, (attr.b[attr.len-1] != ',' || attr.b[attr.len-2] != ',')) attr.len -= 1; - if (attr.len == 2) + if (attr.len == 1) attr.len = 0; } if (offset == start - line_start)