diff --git a/addons/godot_xterm/buffer/buffer.gd b/addons/godot_xterm/buffer/buffer.gd index 2c81ba8..3c7ce4f 100644 --- a/addons/godot_xterm/buffer/buffer.gd +++ b/addons/godot_xterm/buffer/buffer.gd @@ -291,8 +291,8 @@ func _reflow_smaller(new_cols: int, new_rows: int) -> void: # Record original lines so they don't get overridden when we rearrange the list var original_lines = [] - for i in range(lines.length): - original_lines.append(lines.get_line(i)) + for j in range(lines.length): + original_lines.append(lines.get_line(j)) var original_lines_length = lines.length var original_line_index = original_lines_length - 1 @@ -322,10 +322,10 @@ func _reflow_smaller(new_cols: int, new_rows: int) -> void: # Update markers var insert_count_emitted = 0 - for i in range(insert_events.size() - 1, -1, -1): - insert_events[i].index += insert_count_emitted - lines.emit_signal("inserted", insert_events[i]) - insert_count_emitted += insert_events[i].amount + for k in range(insert_events.size() - 1, -1, -1): + insert_events[k].index += insert_count_emitted + lines.emit_signal("inserted", insert_events[k]) + insert_count_emitted += insert_events[k].amount var amount_to_trim = max(0, original_lines_length + count_to_insert - lines.max_length) if amount_to_trim > 0: lines.emit_signal("trimmed", amount_to_trim) diff --git a/addons/godot_xterm/buffer/buffer_line.gd b/addons/godot_xterm/buffer/buffer_line.gd index 44d157b..b7d49ac 100644 --- a/addons/godot_xterm/buffer/buffer_line.gd +++ b/addons/godot_xterm/buffer/buffer_line.gd @@ -132,8 +132,8 @@ func insert_cells(pos: int, n: int, fill_cell_data, erase_attr = null) -> void: while i >= 0: set_cell(pos + n + i, load_cell(pos + i, cell)) i -= 1 - for i in range(n): - set_cell(pos + i, fill_cell_data) + for j in range(n): + set_cell(pos + j, fill_cell_data) else: for i in range(pos, length): set_cell(i, fill_cell_data) diff --git a/addons/godot_xterm/buffer/buffer_reflow.gd b/addons/godot_xterm/buffer/buffer_reflow.gd index d8a3fbd..1a55143 100644 --- a/addons/godot_xterm/buffer/buffer_reflow.gd +++ b/addons/godot_xterm/buffer/buffer_reflow.gd @@ -75,8 +75,8 @@ static func reflow_larger_get_lines_to_remove(lines, old_cols: int, new_cols: in # Work backwards and remove any rows at the end that only contain null cells var count_to_remove = 0 - for i in range(wrapped_lines.size() - 1, 0, -1): - if i > dest_line_index or wrapped_lines[i].get_trimmed_length() == 0: + for j in range(wrapped_lines.size() - 1, 0, -1): + if j > dest_line_index or wrapped_lines[j].get_trimmed_length() == 0: count_to_remove += 1 else: break diff --git a/addons/godot_xterm/circular_list.gd b/addons/godot_xterm/circular_list.gd index 5f4e71d..4f6f191 100644 --- a/addons/godot_xterm/circular_list.gd +++ b/addons/godot_xterm/circular_list.gd @@ -128,8 +128,8 @@ func splice(start: int, delete_count: int, items: Array = []) -> void: while i >= start: _array[_get_cyclic_index(i + items.size())] = _array[_get_cyclic_index(i)] i -= 1 - for i in range(items.size()): - _array[_get_cyclic_index(start + i)] = items[i] + for j in range(items.size()): + _array[_get_cyclic_index(start + j)] = items[j] # Adjust length as needed if length + items.size() > max_length: