From c9e9b8d9415cbd7239a713913b87fe5a9ace676d Mon Sep 17 00:00:00 2001 From: Jorge Morante Date: Mon, 14 Jan 2019 08:35:14 +0100 Subject: [PATCH] don't eat part of output --- scripts/hinter.awk | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/scripts/hinter.awk b/scripts/hinter.awk index a0aab7c..0c5bfb8 100644 --- a/scripts/hinter.awk +++ b/scripts/hinter.awk @@ -59,16 +59,15 @@ BEGIN { line = post_match; } - if (length(post_match) > 0) { - tokens_by_line[n_lines][n_tokens]["value"] = post_match - tokens_by_line[n_lines][n_tokens]["type"] = "text" - - n_tokens++ - } if (n_tokens == 0) { tokens_by_line[n_lines][n_tokens]["value"] = line tokens_by_line[n_lines][n_tokens]["type"] = "text" + } else if (length(post_match) > 0) { + tokens_by_line[n_lines][n_tokens]["value"] = post_match + tokens_by_line[n_lines][n_tokens]["type"] = "text" + + n_tokens++ } n_lines++