Skip to content

Commit

Permalink
fix: fix markdown preview plugin loaded from LazyExtras
Browse files Browse the repository at this point in the history
There was an error when installing
https://github.com/iamcco/markdown-preview.nvim through plugins in
LazyVim through LazyExtras.
This commit applies a fix found in an issue opened for the error.

Related issues:
iamcco/markdown-preview.nvim#690

Fixes pull request (not merged yet at time of writing):
LazyVim/LazyVim#4196
  • Loading branch information
hafezfhmi committed Aug 5, 2024
1 parent 10a83eb commit 0faee68
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 4 deletions.
8 changes: 4 additions & 4 deletions nvim/lazy-lock.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"flash.nvim": { "branch": "main", "commit": "34c7be146a91fec3555c33fe89c7d643f6ef5cf1" },
"friendly-snippets": { "branch": "main", "commit": "00ebcaa159e817150bd83bfe2d51fa3b3377d5c4" },
"fzf-lua": { "branch": "main", "commit": "73bdec9ac5da578376bdc5a705ea80a19baa4942" },
"gitsigns.nvim": { "branch": "main", "commit": "564849a17bf5c5569e0bae98c8328de9c7a1ed29" },
"gitsigns.nvim": { "branch": "main", "commit": "58bd9e98d8e3c5a1c98af312e85247ee1afd3ed2" },
"grug-far.nvim": { "branch": "main", "commit": "3e491ca05c50f87d02543adb010aed9dfb1e12c1" },
"inc-rename.nvim": { "branch": "main", "commit": "8ba77017ca468f3029bf88ef409c2d20476ea66b" },
"indent-blankline.nvim": { "branch": "master", "commit": "65e20ab94a26d0e14acac5049b8641336819dfc7" },
Expand All @@ -24,8 +24,8 @@
"lualine.nvim": { "branch": "master", "commit": "544dd1583f9bb27b393f598475c89809c4d5e86b" },
"luvit-meta": { "branch": "main", "commit": "ce76f6f6cdc9201523a5875a4471dcfe0186eb60" },
"markdown-preview.nvim": { "branch": "master", "commit": "a923f5fc5ba36a3b17e289dc35dc17f66d0548ee" },
"markdown.nvim": { "branch": "main", "commit": "9cdfae29259f2c7bef3c9c13d9e09b506020d5ca" },
"mason-lspconfig.nvim": { "branch": "main", "commit": "fd69d5c782a28420d51b648a3d7fe88df569d391" },
"markdown.nvim": { "branch": "main", "commit": "aeb5cec617c3bd5738ab82ba2c3f9ccdc27656c2" },
"mason-lspconfig.nvim": { "branch": "main", "commit": "62360f061d45177dda8afc1b0fd1327328540301" },
"mason.nvim": { "branch": "main", "commit": "e2f7f9044ec30067bc11800a9e266664b88cda22" },
"mini.ai": { "branch": "main", "commit": "45587078f323eaf41b9f701bbc04f8d1ab008979" },
"mini.animate": { "branch": "main", "commit": "320fb35460238c436407cd779f63abad98e84870" },
Expand All @@ -45,7 +45,7 @@
"nvim-notify": { "branch": "master", "commit": "d333b6f167900f6d9d42a59005d82919830626bf" },
"nvim-snippets": { "branch": "main", "commit": "56b4052f71220144689caaa2e5b66222ba5661eb" },
"nvim-treesitter": { "branch": "master", "commit": "d7353a6b72008b38aa873ace49aa97bea257941b" },
"nvim-treesitter-textobjects": { "branch": "master", "commit": "5a5458bc6202d5ae5c04331763a1bce0265a6a3a" },
"nvim-treesitter-textobjects": { "branch": "master", "commit": "d45a1150580745a1905d74185b544af3ea6f709d" },
"nvim-ts-autotag": { "branch": "main", "commit": "dc5e1687ab76ee02e0f11c5ce137f530b36e98b3" },
"persistence.nvim": { "branch": "main", "commit": "f6aad7dde7fcf54148ccfc5f622c6d5badd0cc3d" },
"plenary.nvim": { "branch": "master", "commit": "a3e3bc82a3f95c5ed0d7201546d5d2c19b20d683" },
Expand Down
21 changes: 21 additions & 0 deletions nvim/lua/plugins/markdownpreview.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
return {
{
-- Install markdown preview, use npx if available.
"iamcco/markdown-preview.nvim",
cmd = { "MarkdownPreviewToggle", "MarkdownPreview", "MarkdownPreviewStop" },
ft = { "markdown" },
build = function(plugin)
if vim.fn.executable("npx") then
vim.cmd("!cd " .. plugin.dir .. " && cd app && npx --yes yarn install")
else
vim.cmd([[Lazy load markdown-preview.nvim]])
vim.fn["mkdp#util#install"]()
end
end,
init = function()
if vim.fn.executable("npx") then
vim.g.mkdp_filetypes = { "markdown" }
end
end,
},
}

0 comments on commit 0faee68

Please sign in to comment.