diff --git a/src/ui/bigtext/highlight_regex.py b/src/ui/bigtext/highlight_regex.py index 543f6d7..7e840a4 100644 --- a/src/ui/bigtext/highlight_regex.py +++ b/src/ui/bigtext/highlight_regex.py @@ -35,6 +35,12 @@ class HighlightRegex(Highlight): def compute_highlight(self, line: Line) -> Optional[List[HighlightedRange]]: result = [] + + if len(self.query) == 0: + # query is empty - this would result in many hits and is quite expensive + # This happens with the highlighter we use for the selected text and maybe for the current filter query. + return result + # print("execute regex: %s in %s" % (self.regex, line.line())) match_iter = re.finditer(self.regex, line.line()) for match in match_iter: