Fix journal_auto_open clash with calendar (fixes #324)

* refs journal-auto-open-fix: doc: adding documentation of the journal_auto_open configuration option

* refs journal-auto-open-fix: fix: correcting the behavior of gotodate and gotothisweek when opening a day from the calendar and the journal_auto_open option is set

closes #324
This commit is contained in:
Tonitum
2024-04-16 01:40:29 -06:00
committed by GitHub
parent 39c7945d6d
commit adbe1ea3c2
2 changed files with 19 additions and 0 deletions

View File

@@ -1643,6 +1643,10 @@ local function GotoDate(opts)
local fexists = fileutils.file_exists(fname)
local function picker()
if opts.journal_auto_open then
if opts.calendar == true then
-- ensure that the calendar window is not improperly overwritten
vim.cmd("wincmd w")
end
vim.cmd("e " .. fname)
else
find_files_sorted({
@@ -2550,6 +2554,10 @@ local function GotoThisWeek(opts)
local fexists = fileutils.file_exists(fname)
local function picker()
if opts.journal_auto_open then
if opts.calendar == true then
-- ensure that the calendar window is not improperly overwritten
vim.cmd("wincmd w")
end
vim.cmd("e " .. fname)
else
find_files_sorted({