Skip to content

Commit

Permalink
Merge branch 'main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
hsnotebook authored Aug 9, 2024
2 parents 4bea625 + 14e0427 commit 1b0dd6e
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 8 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

- Fixed an edge case with collecting backlinks.
- Fixed typo in `ObsidianPasteImg`'s command description
- Fixed the case when `opts.attachments` is `nil`.

## [v3.9.0](https://github.com/epwalsh/obsidian.nvim/releases/tag/v3.9.0) - 2024-07-11

Expand Down
10 changes: 6 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -129,9 +129,10 @@ return {
-- Replace the above line with this if you only want to load obsidian.nvim for markdown files in your vault:
-- event = {
-- -- If you want to use the home shortcut '~' here you need to call 'vim.fn.expand'.
-- -- E.g. "BufReadPre " .. vim.fn.expand "~" .. "/my-vault/**.md"
-- "BufReadPre path/to/my-vault/**.md",
-- "BufNewFile path/to/my-vault/**.md",
-- -- E.g. "BufReadPre " .. vim.fn.expand "~" .. "/my-vault/*.md"
-- -- refer to `:h file-pattern` for more examples
-- "BufReadPre path/to/my-vault/*.md",
-- "BufNewFile path/to/my-vault/*.md",
-- },
dependencies = {
-- Required.
Expand Down Expand Up @@ -391,12 +392,13 @@ This is a complete list of all of the options that can be passed to `require("ob
vim.fn.jobstart({"open", url}) -- Mac OS
-- vim.fn.jobstart({"xdg-open", url}) -- linux
-- vim.cmd(':silent exec "!start ' .. url .. '"') -- Windows
-- vim.ui.open(url) -- need Neovim 0.10.0+
end,

-- Optional, by default when you use `:ObsidianFollowLink` on a link to an image
-- file it will be ignored but you can customize this behavior here.
---@param img string
follow_url_func = function(img)
follow_img_func = function(img)
vim.fn.jobstart { "qlmanage", "-p", img } -- Mac OS quick look preview
-- vim.fn.jobstart({"xdg-open", url}) -- linux
-- vim.cmd(':silent exec "!start ' .. url .. '"') -- Windows
Expand Down
10 changes: 6 additions & 4 deletions doc/obsidian.txt
Original file line number Diff line number Diff line change
Expand Up @@ -176,9 +176,10 @@ USING LAZY.NVIM ~
-- Replace the above line with this if you only want to load obsidian.nvim for markdown files in your vault:
-- event = {
-- -- If you want to use the home shortcut '~' here you need to call 'vim.fn.expand'.
-- -- E.g. "BufReadPre " .. vim.fn.expand "~" .. "/my-vault/**.md"
-- "BufReadPre path/to/my-vault/**.md",
-- "BufNewFile path/to/my-vault/**.md",
-- -- E.g. "BufReadPre " .. vim.fn.expand "~" .. "/my-vault/*.md"
-- -- refer to `:h file-pattern` for more examples
-- "BufReadPre path/to/my-vault/*.md",
-- "BufNewFile path/to/my-vault/*.md",
-- },
dependencies = {
-- Required.
Expand Down Expand Up @@ -447,12 +448,13 @@ carefully and customize it to your needs:
vim.fn.jobstart({"open", url}) -- Mac OS
-- vim.fn.jobstart({"xdg-open", url}) -- linux
-- vim.cmd(':silent exec "!start ' .. url .. '"') -- Windows
-- vim.ui.open(url) -- need Neovim 0.10.0+
end,

-- Optional, by default when you use `:ObsidianFollowLink` on a link to an image
-- file it will be ignored but you can customize this behavior here.
---@param img string
follow_url_func = function(img)
follow_img_func = function(img)
vim.fn.jobstart { "qlmanage", "-p", img } -- Mac OS quick look preview
-- vim.fn.jobstart({"xdg-open", url}) -- linux
-- vim.cmd(':silent exec "!start ' .. url .. '"') -- Windows
Expand Down
3 changes: 3 additions & 0 deletions lua/obsidian/config.lua
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,9 @@ config.ClientOpts.normalize = function(opts, defaults)
end

if opts.image_name_func then
if opts.attachments == nil then
opts.attachments = {}
end
opts.attachments.img_name_func = opts.image_name_func
opts.image_name_func = nil
end
Expand Down

0 comments on commit 1b0dd6e

Please sign in to comment.