fix(py): changed grep output

This commit is contained in:
quenousimporte 2023-09-15 14:01:26 +02:00
parent cc13cb0962
commit f4029760a1
1 changed files with 4 additions and 2 deletions

View File

@ -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