From 761bf2eb2f138efdde33a24ae4cdc89ddb0836b5 Mon Sep 17 00:00:00 2001 From: sunyakun Date: Thu, 12 Oct 2017 09:25:20 +0800 Subject: [PATCH] hightlight the search keywords --- cheat/sheets.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/cheat/sheets.py b/cheat/sheets.py index 1a0b28e..e60bffb 100644 --- a/cheat/sheets.py +++ b/cheat/sheets.py @@ -84,6 +84,8 @@ def search(term): match = '' for line in open(cheatsheet[1]): if term in line: + if 'CHEATCOLORS' in os.environ: + line = line.replace(term, '\033[1;31m' + term + '\033[0m'); match += ' ' + line if match != '':