Simply close the Open dialog if you select the open file

This commit is contained in:
Isaiah Odhner 2023-04-17 13:41:48 -04:00
parent 8ec24a8fdc
commit d950295df7

View File

@ -960,6 +960,9 @@ class PaintApp(App):
if self.directory_tree_selected_path: if self.directory_tree_selected_path:
filename = os.path.join(self.directory_tree_selected_path, filename) filename = os.path.join(self.directory_tree_selected_path, filename)
if filename: if filename:
if self.filename and os.path.samefile(filename, self.filename):
window.close()
return
with open(filename, "r") as f: with open(filename, "r") as f:
content = f.read() # f is out of scope in go_ahead() content = f.read() # f is out of scope in go_ahead()
def go_ahead(): def go_ahead():