From d3b93caff854b432f5b8586f7f4677f646cfb2ea Mon Sep 17 00:00:00 2001 From: Capypara Date: Thu, 8 Aug 2024 19:26:36 +0200 Subject: [PATCH] Fix lockup on loading scripts with opcode at col 0 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)