Skip to content

Commit

Permalink
Fix lockup on loading scripts with opcode at col 0 (#146)
Browse files Browse the repository at this point in the history
Signed-off-by: Capypara <[email protected]>
  • Loading branch information
theCapypara authored Aug 10, 2024
1 parent 3e0278f commit 68647af
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions skytemple_ssb_debugger/model/editor_text_mark_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 68647af

Please sign in to comment.