From accf09c4f9153627c914057e33dbe421674607c4 Mon Sep 17 00:00:00 2001 From: rxi Date: Sat, 25 Apr 2020 13:26:55 +0100 Subject: [PATCH] Changed printed filenames to use format-specifier "%s" instead of %q Fixes #22 --- data/core/commands/doc.lua | 2 +- data/core/init.lua | 6 +++--- data/plugins/autoreload.lua | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/data/core/commands/doc.lua b/data/core/commands/doc.lua index cac62f6..c62f92c 100644 --- a/data/core/commands/doc.lua +++ b/data/core/commands/doc.lua @@ -56,7 +56,7 @@ end local function save(filename) doc():save(filename) - core.log("Saved %q", doc().filename) + core.log("Saved \"%s\"", doc().filename) end diff --git a/data/core/init.lua b/data/core/init.lua index ba2319b..9d0f31d 100644 --- a/data/core/init.lua +++ b/data/core/init.lua @@ -133,7 +133,7 @@ function core.quit(force) if dirty_count > 0 then local text if dirty_count == 1 then - text = string.format("%q has unsaved changes. Quit anyway?", dirty_name) + text = string.format("\"%s\" has unsaved changes. Quit anyway?", dirty_name) else text = string.format("%d docs have unsaved changes. Quit anyway?", dirty_count) end @@ -210,7 +210,7 @@ function core.open_doc(filename) -- no existing doc for filename; create new local doc = Doc(filename) table.insert(core.docs, doc) - core.log_quiet(filename and "Opened doc %q" or "Opened new doc", filename) + core.log_quiet(filename and "Opened doc \"%s\"" or "Opened new doc", filename) return doc end @@ -339,7 +339,7 @@ function core.step() local doc = core.docs[i] if #core.get_views_referencing_doc(doc) == 0 then table.remove(core.docs, i) - core.log_quiet("Closed doc %q", doc:get_name()) + core.log_quiet("Closed doc \"%s\"", doc:get_name()) end end diff --git a/data/plugins/autoreload.lua b/data/plugins/autoreload.lua index be85097..604589d 100644 --- a/data/plugins/autoreload.lua +++ b/data/plugins/autoreload.lua @@ -23,7 +23,7 @@ local function reload_doc(doc) update_time(doc) doc:clean() - core.log_quiet("Auto-reloaded doc %q", doc.filename) + core.log_quiet("Auto-reloaded doc \"%s\"", doc.filename) end