From 68647af3038c15c68e95e7ed28a09dc8f5e890c4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marco=20K=C3=B6pcke?= Date: Sat, 10 Aug 2024 19:26:29 +0200 Subject: [PATCH] Fix lockup on loading scripts with opcode at col 0 (#146) Signed-off-by: Capypara --- skytemple_ssb_debugger/model/editor_text_mark_util.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/skytemple_ssb_debugger/model/editor_text_mark_util.py b/skytemple_ssb_debugger/model/editor_text_mark_util.py index ff51ef0..269c922 100644 --- a/skytemple_ssb_debugger/model/editor_text_mark_util.py +++ b/skytemple_ssb_debugger/model/editor_text_mark_util.py @@ -90,6 +90,9 @@ def remove_breakpoint_line_mark(cls, b: GtkSource.Buffer, ssb_filename: str, opc @classmethod def create_opcode_mark(cls, b: GtkSource.Buffer, ssb_filename: str, offset: int, line: int, col: int, is_for_macro_call: bool): + if col == 0: + # XXX: Bug in GtkSourceView 4. Placing it at col 0 will cause it to hang. It shouldn't be a big issue in most cases. + col = 1 textiter = b.get_iter_at_line_offset(line, col) macro_call_suffix = '_call' if is_for_macro_call else '' b.create_source_mark(f'opcode_<<<{ssb_filename}>>>_{offset}{macro_call_suffix}', CATEGORY_OPCODE, textiter)