diff --git a/utils.py b/utils.py index ec78e85..f7bc25e 100644 --- a/utils.py +++ b/utils.py @@ -110,6 +110,11 @@ class Utils: if len(sys.argv) == 1: # if no parameters were passed to the editor file_path = self.app.settings.last_opened_file - if os.path.isfile(file_path): + if os.path.isfile(file_path): # open last opened file if it still exists else open the example file + file = File(self.app, file_path, file_path.split("/")[-1]) + self.app.open_files[file_path] = file + + else: + file_path = f"{os.path.dirname(os.path.abspath(__file__))}/example.txt" file = File(self.app, file_path, file_path.split("/")[-1]) self.app.open_files[file_path] = file