mirror of
https://github.com/Ascyii/telekasten.nvim.git
synced 2026-01-01 06:14:23 -05:00
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:
@@ -103,6 +103,9 @@ telekasten.setup({opts})
|
|||||||
dailies_create_nonexisting = true, -- create non-existing dailies
|
dailies_create_nonexisting = true, -- create non-existing dailies
|
||||||
weeklies_create_nonexisting = true, -- create non-existing weeklies
|
weeklies_create_nonexisting = true, -- create non-existing weeklies
|
||||||
|
|
||||||
|
-- skip telescope prompt for goto_today and goto_thisweek
|
||||||
|
journal_auto_open = false,
|
||||||
|
|
||||||
-- Image link style",
|
-- Image link style",
|
||||||
-- wiki: ![[image name]]
|
-- wiki: ![[image name]]
|
||||||
-- markdown: 
|
-- markdown: 
|
||||||
@@ -347,6 +350,14 @@ telekasten.setup({opts})
|
|||||||
|
|
||||||
Default: true
|
Default: true
|
||||||
|
|
||||||
|
*telekasten.settings.journal_auto_open*
|
||||||
|
journal_auto_open: ~
|
||||||
|
Flag that determines whether the telescope picker should be used when
|
||||||
|
opening the daily and weekly notes, or if they should be directly
|
||||||
|
created/opened.
|
||||||
|
|
||||||
|
Default: false
|
||||||
|
|
||||||
*telekasten.settings.template_new_note*
|
*telekasten.settings.template_new_note*
|
||||||
template_new_note: ~
|
template_new_note: ~
|
||||||
Markdown template for new notes. Set to `nil` if you don't want a
|
Markdown template for new notes. Set to `nil` if you don't want a
|
||||||
|
|||||||
@@ -1643,6 +1643,10 @@ local function GotoDate(opts)
|
|||||||
local fexists = fileutils.file_exists(fname)
|
local fexists = fileutils.file_exists(fname)
|
||||||
local function picker()
|
local function picker()
|
||||||
if opts.journal_auto_open then
|
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)
|
vim.cmd("e " .. fname)
|
||||||
else
|
else
|
||||||
find_files_sorted({
|
find_files_sorted({
|
||||||
@@ -2550,6 +2554,10 @@ local function GotoThisWeek(opts)
|
|||||||
local fexists = fileutils.file_exists(fname)
|
local fexists = fileutils.file_exists(fname)
|
||||||
local function picker()
|
local function picker()
|
||||||
if opts.journal_auto_open then
|
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)
|
vim.cmd("e " .. fname)
|
||||||
else
|
else
|
||||||
find_files_sorted({
|
find_files_sorted({
|
||||||
|
|||||||
Reference in New Issue
Block a user