mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-12 18:35:35 +00:00
findbar: highlight multiple matches in a message
This commit is contained in:
parent
6cfca1c322
commit
634f17ed7d
1 changed files with 9 additions and 3 deletions
|
@ -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 ()
|
||||
|
||||
|
|
Loading…
Reference in a new issue