Skip to content

Commit

Permalink
Bug fix 2
Browse files Browse the repository at this point in the history
  • Loading branch information
AbhiK002 authored Oct 13, 2023
1 parent 52933f7 commit b6f7487
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion main.py
Original file line number Diff line number Diff line change
Expand Up @@ -888,12 +888,18 @@ def save_before_closing_instance(self):
if self.new_file and self.editor.get("1.0", END).rstrip('\n') == '':
self.close_instance()
else:
self.root.attributes('-topmost', False)
# if pinned
status = self.pin_state.get()
if status == "true":
self.pin_toggle.invoke()

choice = askyesnocancel("File Unsaved", f"Do you want to save the file "
f"'{self.filename.get()}' before closing it?")
if choice == YES:
self.save_window(close_after_saving=True)
elif choice is None:
if status == "true":
self.pin_toggle.invoke()
return
else:
self.close_instance()
Expand Down

0 comments on commit b6f7487

Please sign in to comment.