From 96ceab036226808ebf6422a463b1435b79fef3ea Mon Sep 17 00:00:00 2001 From: Sleepful Date: Mon, 10 Jul 2023 16:09:53 -0600 Subject: [PATCH] Fixes bug with new callback flow With the new callback parameter it becomes necessary to fill the nil arguments of a function if it is to receive the callback as the last argument to reproduce bug try creating a new weekly note. --- lua/telekasten.lua | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lua/telekasten.lua b/lua/telekasten.lua index eea27c8..0dbbb17 100644 --- a/lua/telekasten.lua +++ b/lua/telekasten.lua @@ -464,7 +464,7 @@ local function create_note_from_template( -- now write the output file, substituting vars line by line local file_dir = filepath:match("(.*/)") or "" - check_dir_and_ask(file_dir, file_dir, function(dir_succeed) + check_dir_and_ask(file_dir, "Create weekly dir", function(dir_succeed) if dir_succeed == false then return end @@ -1173,6 +1173,7 @@ local function FindDailyNotes(opts) nil, fname, M.note_type_templates.daily, + nil, function() opts.erase = true opts.erase_file = fname @@ -1240,6 +1241,7 @@ local function FindWeeklyNotes(opts) nil, fname, M.note_type_templates.weekly, + nil, function() opts.erase = true opts.erase_file = fname @@ -2570,6 +2572,7 @@ local function GotoThisWeek(opts) nil, fname, M.note_type_templates.weekly, + nil, function() opts.erase = true opts.erase_file = fname