From ba9bbc9e4619f096be00f5488d1c341a94fae08a Mon Sep 17 00:00:00 2001 From: witekfl Date: Wed, 11 Jul 2012 11:39:26 +0200 Subject: [PATCH] draw_space: Check for a non-space only in first 10 chars of the line. I know it is totally brainless, but buildlogs.pld-linux.org looks good now. --- src/viewer/text/draw.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/viewer/text/draw.c b/src/viewer/text/draw.c index 6ef27042f..bef5166d4 100644 --- a/src/viewer/text/draw.c +++ b/src/viewer/text/draw.c @@ -294,6 +294,7 @@ draw_doc(struct session *ses, struct document_view *doc_view, int active) int st = int_max(vx, 0); int en = int_min(doc_view->document->data[y].length, box->width + vx); + int max = int_min(en, st + 10); if (en - st > 0) { draw_line(term, box->x + st - vx, box->y + y - vy, @@ -301,7 +302,7 @@ draw_doc(struct session *ses, struct document_view *doc_view, int active) &doc_view->document->data[y].chars[st]); last = &doc_view->document->data[y].chars[en - 1]; } - for (i = st; i < en; i++) { + for (i = st; i < max; i++) { if (doc_view->document->data[y].chars[i].data != ' ') { first = &doc_view->document->data[y].chars[i]; break;