From f246b3d19caaff7b5d44cb73c2f6628531a6db64 Mon Sep 17 00:00:00 2001 From: hius07 <62179190+hius07@users.noreply.github.com> Date: Sun, 21 Jan 2024 12:11:16 +0200 Subject: [PATCH] Text editor: refresh path on saving file (#11396) File size was changed. --- plugins/texteditor.koplugin/main.lua | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/plugins/texteditor.koplugin/main.lua b/plugins/texteditor.koplugin/main.lua index 2cea99c6d..952651ecd 100644 --- a/plugins/texteditor.koplugin/main.lua +++ b/plugins/texteditor.koplugin/main.lua @@ -493,10 +493,11 @@ function TextEditor:readFileContent(file_path) end function TextEditor:saveFileContent(file_path, content) - local file, err = io.open(file_path, "wb") - if file then - file:write(content) - file:close() + local ok, err = util.writeToFile(content, file_path) + if ok then + if self.ui.file_chooser then + self.ui.file_chooser:refreshPath() + end logger.info("TextEditor: saved file", file_path) return true end