We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 884758b commit d6f54a2Copy full SHA for d6f54a2
1 file changed
Lib/idlelib/iomenu.py
@@ -262,22 +262,8 @@ def reload(self, event):
262
self.text.focus_set()
263
return "break"
264
265
- # Save cursor position
266
- insert_pos = self.text.index("insert")
267
- yview_pos = self.text.yview()
268
-
269
# Reload the file
270
- if self.loadfile(self.filename):
271
- # Try to restore cursor position if the file still has that line
272
- try:
273
- self.text.mark_set("insert", insert_pos)
274
- self.text.see("insert")
275
- # Restore vertical scroll position
276
- self.text.yview_moveto(yview_pos[0])
277
- except Exception:
278
- # If position doesn't exist anymore, go to top
279
- self.text.mark_set("insert", "1.0")
280
+ self.loadfile(self.filename)
281
282
283
0 commit comments