mirror of
https://github.com/1j01/textual-paint.git
synced 2024-12-21 13:51:45 +03:00
Simply close the Open dialog if you select the open file
This commit is contained in:
parent
8ec24a8fdc
commit
d950295df7
3
paint.py
3
paint.py
@ -960,6 +960,9 @@ class PaintApp(App):
|
||||
if self.directory_tree_selected_path:
|
||||
filename = os.path.join(self.directory_tree_selected_path, filename)
|
||||
if filename:
|
||||
if self.filename and os.path.samefile(filename, self.filename):
|
||||
window.close()
|
||||
return
|
||||
with open(filename, "r") as f:
|
||||
content = f.read() # f is out of scope in go_ahead()
|
||||
def go_ahead():
|
||||
|
Loading…
Reference in New Issue
Block a user