From f4029760a1f247e08faf2ead563a295039a620c7 Mon Sep 17 00:00:00 2001 From: quenousimporte Date: Fri, 15 Sep 2023 14:01:26 +0200 Subject: [PATCH] fix(py): changed grep output --- cli/app.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/cli/app.py b/cli/app.py index f1d8cac..2e04801 100644 --- a/cli/app.py +++ b/cli/app.py @@ -14,10 +14,12 @@ def listnotes(filter = "", checkcontent = False): matching.append(data[i]) elif checkcontent and filter.lower() in data[i]["content"].lower(): print("[" + str(i) + "]", data[i]["title"]) - for line in data[i]["content"].split("\n"): + lines = data[i]["content"].split("\n") + for j in range(len(lines)): + line = lines[j] if filter.lower() in line.lower(): index = line.lower().index(filter.lower()) - print("\t", line[index:index+30]) + print("\t" + str(j) + ":", line[:100]) matching.append(data[i]) return matching