Attempted further memory leak prevention; fixed bugs from moving to python 12; misc.

This commit is contained in:
2024-09-11 02:11:00 -05:00
parent 35456f2bca
commit 3a2e8eeb08
11 changed files with 47 additions and 51 deletions

View File

@@ -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))