mirror of
https://github.com/Ascyii/telekasten.nvim.git
synced 2026-01-01 06:14:23 -05:00
fix: daily/weekly search when the folder is set to the base folder
* refs 321-daily-weekly-picker: feat: added plenary pattern/depth options to address behavior when the weekly/daily folder is configured to the same as the base notes folder * refs 321-daily-weekly-picker: format: address styling closes #321
This commit is contained in:
@@ -893,8 +893,11 @@ local picker_actions = {}
|
||||
-- - this requires the telescope-media-files.nvim extension
|
||||
local function find_files_sorted(opts)
|
||||
opts = opts or {}
|
||||
local search_pattern = opts.search_pattern or nil
|
||||
local search_depth = opts.search_depth or nil
|
||||
local scan_opts = { search_pattern = search_pattern, depth = search_depth }
|
||||
|
||||
local file_list = scan.scan_dir(opts.cwd, {})
|
||||
local file_list = scan.scan_dir(opts.cwd, scan_opts)
|
||||
local filter_extensions = opts.filter_extensions or M.Cfg.filter_extensions
|
||||
file_list = filter_filetypes(file_list, filter_extensions)
|
||||
local sort_option = opts.sort or "filename"
|
||||
@@ -1194,6 +1197,8 @@ local function FindDailyNotes(opts)
|
||||
prompt_title = "Find daily note",
|
||||
cwd = M.Cfg.dailies,
|
||||
find_command = M.Cfg.find_command,
|
||||
search_pattern = "%d%d%d%d%-%d%d%-%d%d",
|
||||
search_depth = 1,
|
||||
attach_mappings = function(_, map)
|
||||
actions.select_default:replace(
|
||||
picker_actions.select_default
|
||||
@@ -1261,6 +1266,8 @@ local function FindWeeklyNotes(opts)
|
||||
prompt_title = "Find weekly note",
|
||||
cwd = M.Cfg.weeklies,
|
||||
find_command = M.Cfg.find_command,
|
||||
search_pattern = "%d%d%d%d%-W%d+",
|
||||
search_depth = 1,
|
||||
attach_mappings = function(_, map)
|
||||
actions.select_default:replace(
|
||||
picker_actions.select_default
|
||||
|
||||
Reference in New Issue
Block a user