Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -425,7 +425,7 @@ Prompt to create and open a new markdown note.
```lua
---@class DotMd.CreateFileOpts
---@field open? boolean Open the file after creation, default is true
---@field split? "vertical" | "horizontal" | "none" Split direction for new or existing files, default is `vertical`
---@field split? "vertical" | "horizontal" | "none" Split direction for new or existing files, default is based on `default_split` in config

---@param opts? DotMd.CreateFileOpts
require("dotmd").create_note(opts)
Expand All @@ -443,7 +443,7 @@ Open/create today’s todo and roll over tasks.
```lua
---@class DotMd.CreateFileOpts
---@field open? boolean Open the file after creation, default is true
---@field split? "vertical" | "horizontal" | "none" Split direction for new or existing files, default is `vertical`
---@field split? "vertical" | "horizontal" | "none" Split direction for new or existing files, default is based on `default_split` in config

---@param opts? DotMd.CreateFileOpts
require("dotmd").create_todo_today(opts)
Expand All @@ -461,7 +461,7 @@ Open/create a journal entry for today.
```lua
---@class DotMd.CreateFileOpts
---@field open? boolean Open the file after creation, default is true
---@field split? "vertical" | "horizontal" | "none" Split direction for new or existing files, default is `vertical`
---@field split? "vertical" | "horizontal" | "none" Split direction for new or existing files, default is based on `default_split` in config

---@param opts? DotMd.CreateFileOpts
require("dotmd").create_journal(opts)
Expand All @@ -479,7 +479,7 @@ Open the central `inbox.md`.
```lua
---@class DotMd.CreateFileOpts
---@field open? boolean Open the file after creation, default is true
---@field split? "vertical" | "horizontal" | "none" Split direction for new or existing files, default is `vertical`
---@field split? "vertical" | "horizontal" | "none" Split direction for new or existing files, default is based on `default_split` in config

---@param opts? DotMd.CreateFileOpts
require("dotmd").create_journal(opts)
Expand Down
8 changes: 4 additions & 4 deletions doc/dotmd.nvim.txt
Original file line number Diff line number Diff line change
Expand Up @@ -438,7 +438,7 @@ Prompt to create and open a new markdown note.
>lua
---@class DotMd.CreateFileOpts
---@field open? boolean Open the file after creation, default is true
---@field split? "vertical" | "horizontal" | "none" Split direction for new or existing files, default is `vertical`
---@field split? "vertical" | "horizontal" | "none" Split direction for new or existing files, default is based on `default_split` in config

---@param opts? DotMd.CreateFileOpts
require("dotmd").create_note(opts)
Expand All @@ -458,7 +458,7 @@ Open/create today’s todo and roll over tasks.
>lua
---@class DotMd.CreateFileOpts
---@field open? boolean Open the file after creation, default is true
---@field split? "vertical" | "horizontal" | "none" Split direction for new or existing files, default is `vertical`
---@field split? "vertical" | "horizontal" | "none" Split direction for new or existing files, default is based on `default_split` in config

---@param opts? DotMd.CreateFileOpts
require("dotmd").create_todo_today(opts)
Expand All @@ -478,7 +478,7 @@ Open/create a journal entry for today.
>lua
---@class DotMd.CreateFileOpts
---@field open? boolean Open the file after creation, default is true
---@field split? "vertical" | "horizontal" | "none" Split direction for new or existing files, default is `vertical`
---@field split? "vertical" | "horizontal" | "none" Split direction for new or existing files, default is based on `default_split` in config

---@param opts? DotMd.CreateFileOpts
require("dotmd").create_journal(opts)
Expand All @@ -498,7 +498,7 @@ Open the central `inbox.md`.
>lua
---@class DotMd.CreateFileOpts
---@field open? boolean Open the file after creation, default is true
---@field split? "vertical" | "horizontal" | "none" Split direction for new or existing files, default is `vertical`
---@field split? "vertical" | "horizontal" | "none" Split direction for new or existing files, default is based on `default_split` in config

---@param opts? DotMd.CreateFileOpts
require("dotmd").create_journal(opts)
Expand Down
2 changes: 1 addition & 1 deletion lua/dotmd/types.lua
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

---@class DotMd.CreateFileOpts
---@field open? boolean Open the file after creation, default is true
---@field split? "vertical" | "horizontal" | "none" Split direction for new or existing files, default is `vertical`
---@field split? "vertical" | "horizontal" | "none" Split direction for new or existing files, default is based on `default_split` in config

---@class DotMd.PickOpts
---@field type? "notes" | "todos" | "journal" | "all" Pick type, default is `notes`
Expand Down
4 changes: 1 addition & 3 deletions lua/dotmd/utils.lua
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,7 @@ local M = {}
function M.merge_default_create_file_opts(opts)
opts = opts or {}
opts.open = opts.open ~= false
opts.split = opts.split
or require("dotmd.config").config.default_split
or "vertical"
opts.split = opts.split or require("dotmd.config").config.default_split
return opts
end

Expand Down
1 change: 0 additions & 1 deletion tests/utils_spec.lua
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ describe("dotmd.utils module", function()
assert.is_true(opts.open)
-- opts.split should be set to either dotmd.config default_split or "vertical"
local expected = require("dotmd.config").config.default_split
or "vertical"
assert.are.equal(expected, opts.split)
end)

Expand Down