Skip to content

Commit 3ed84ec

Browse files
Fix exception in auto-save, Text Editor
1 parent e9356a8 commit 3ed84ec

2 files changed

Lines changed: 5 additions & 4 deletions

File tree

src/robotide/editor/texteditor.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -562,11 +562,10 @@ def on_tree_selection(self, message):
562562
# self.jump = True
563563
next_datafile_controller = message.item and message.item.datafile_controller
564564
if self._editor.datafile_controller == message.item.datafile_controller == next_datafile_controller:
565-
# print(f"DEBUG: OnTreeSelection Same FILE item type={type(message.item)}\n"
566-
# f"value of {self._save_flag=}")
567565
position = self._editor.locate_tree_item(message.item)
568566
self._editor.store_position()
569-
wx.CallAfter(self._editor.source_editor.SetSelection, position[0], position[1])
567+
if position:
568+
wx.CallAfter(self._editor.source_editor.SetSelection, position[0], position[1])
570569
self.jump = True
571570
return
572571
if self._editor.dirty and not self._apply_txt_changes_to_model(auto=False):
@@ -1518,6 +1517,7 @@ def _add_auto_indent(self, line: str):
15181517
self.source_editor.SetSelection(pos, pos)
15191518
self.source_editor.NewLine()
15201519
while tsize > 0:
1520+
# print(f"DEBUG: _add_auto_indent write_ident {tsize=}")
15211521
self.write_ident()
15221522
tsize -= 1
15231523

@@ -1858,6 +1858,7 @@ def on_key_down(self, event):
18581858
return
18591859
selected = self.source_editor.GetSelection()
18601860
if selected[0] == selected[1]:
1861+
# print("DEBUG: on_key_down TAB write_ident")
18611862
self.write_ident()
18621863
else:
18631864
self.indent_block()

src/robotide/version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,4 @@
1515
#
1616
# Automatically generated by `tasks.py`.
1717

18-
VERSION = 'v2.2.5dev3'
18+
VERSION = 'v2.2.5dev4'

0 commit comments

Comments
 (0)