Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

plugings/obsidian: add follow_img_func function setting #2770

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

jonboh
Copy link
Contributor

@jonboh jonboh commented Dec 30, 2024

This setting is almost identical to follow_url_func.
Currently if one tries to add this setting like this:

plugins.obsidian = {
  # ...
  settings = {
    follow_img_func = ''
    function(img)
      vim.fn.jobstart { "xdg-open", img }
    end
  ''; 
    follow_url_func = ''
      function(url)
        vim.fn.jobstart({"xdg-open", url})  -- linux
      end
  '';
}; 
}    

The generated configuration uses the literal string, and fails when used:

      follow_img_func = 'function(img)\n  vim.fn.jobstart({"xdg-open", img})  -- linux\nend\n',
      follow_url_func = function(url)
          vim.fn.jobstart({ "xdg-open", url }) -- linux
      end,

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant