diff --git a/plugins/texteditor.koplugin/main.lua b/plugins/texteditor.koplugin/main.lua index bee254a15..5f4eb65b0 100644 --- a/plugins/texteditor.koplugin/main.lua +++ b/plugins/texteditor.koplugin/main.lua @@ -661,4 +661,13 @@ function TextEditor:onOpenLastEditedFile() end end +-- quickly open and edit a file +-- calls the done_callback function on close +function TextEditor:quickEditFile(file_path, done_callback, possible_new_file) + if done_callback then + self.whenDoneFunc = done_callback + end + self:checkEditFile(file_path, possible_new_file or false) +end + return TextEditor