Attempted further memory leak prevention; fixed bugs from moving to python 12; misc.
This commit is contained in:
@@ -48,7 +48,7 @@ class GrepPreviewWidget(Gtk.Box):
|
||||
return bytes(f"\n<span foreground='{color}'>{target}</span>", "utf-8").decode("utf-8")
|
||||
|
||||
def make_utf8_line_highlight(self, buffer, itr, i, color, target, query):
|
||||
parts = re.split(r"(" + query + ")(?i)", target.replace("\n", ""))
|
||||
parts = re.split(r"(?i)(" + query + ")", target.replace("\n", ""))
|
||||
for part in parts:
|
||||
itr = buffer.get_end_iter()
|
||||
|
||||
@@ -57,4 +57,4 @@ class GrepPreviewWidget(Gtk.Box):
|
||||
else:
|
||||
new_s = f"<span foreground='#000000' background='{color}'>{part}</span>"
|
||||
_part = bytes(new_s, "utf-8").decode("utf-8")
|
||||
buffer.insert_markup(itr, _part, len(_part))
|
||||
buffer.insert_markup(itr, _part, len(_part))
|
Reference in New Issue
Block a user