File tree Expand file tree Collapse file tree 1 file changed +1
-15
lines changed
Expand file tree Collapse file tree 1 file changed +1
-15
lines changed Original file line number Diff line number Diff line change @@ -262,22 +262,8 @@ def reload(self, event):
262262 self .text .focus_set ()
263263 return "break"
264264
265- # Save cursor position
266- insert_pos = self .text .index ("insert" )
267- yview_pos = self .text .yview ()
268-
269265 # 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 .text .see ("insert" )
266+ self .loadfile (self .filename )
281267
282268 self .text .focus_set ()
283269 return "break"
You can’t perform that action at this time.
0 commit comments