diff options
author | René Stadler <mail@renestadler.de> | 2012-09-23 17:22:12 +0200 |
---|---|---|
committer | René Stadler <mail@renestadler.de> | 2012-09-24 02:43:37 +0200 |
commit | cc2e338d1696790f83b8978e43e4d895cd2a63ea (patch) | |
tree | 8d05d9720bc7f7cb45ffb8c8086f9dc062156ee0 /GstDebugViewer | |
parent | 5bc90c6162da1f01f3260f632010f57667501fd6 (diff) |
findbar: highlight multiple matches in a message
Diffstat (limited to 'GstDebugViewer')
-rw-r--r-- | GstDebugViewer/Plugins/FindBar.py | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/GstDebugViewer/Plugins/FindBar.py b/GstDebugViewer/Plugins/FindBar.py index 46e9450..234a6a2 100644 --- a/GstDebugViewer/Plugins/FindBar.py +++ b/GstDebugViewer/Plugins/FindBar.py @@ -43,9 +43,15 @@ class SearchOperation (object): message = model_row[col_id] if search_text in message: - # TODO: Return all match ranges here. - pos = message.find (search_text) - return ((pos, pos + len_search_text,),) + ranges = [] + start = 0 + while True: + pos = message.find (search_text, start) + if pos == -1: + break + ranges.append ((pos, pos + len_search_text,)) + start = pos + len_search_text + return ranges else: return () |