From a58329ecc5c71db6aacee7e468d948ae71129d13 Mon Sep 17 00:00:00 2001 From: NeilBrown Date: Wed, 13 Jan 2016 16:19:25 +1100 Subject: [PATCH] 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 --- doc-text.c | 2 ++ render-lines.c | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) 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) -- 2.39.5