Skip to content

Commit 5c9c55c

Browse files
boydaihungstUzaaft
andauthored
fix(markdown-preview-nvim): Change build command to download prebuilt version of markdown-preview. (#1640)
Co-authored-by: Uzair Aftab <48220549+Uzaaft@users.noreply.github.com>
1 parent 7e2fcd9 commit 5c9c55c

File tree

1 file changed

+1
-16
lines changed
  • lua/astrocommunity/markdown-and-latex/markdown-preview-nvim

1 file changed

+1
-16
lines changed

lua/astrocommunity/markdown-and-latex/markdown-preview-nvim/init.lua

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,7 @@
11
---@type LazySpec
22
return {
33
"iamcco/markdown-preview.nvim",
4-
build = function(plugin)
5-
local package_manager = vim.fn.executable "yarn" and "yarn" or vim.fn.executable "npx" and "npx -y yarn" or false
6-
7-
--- HACK: Use `yarn` or `npx` when possible, otherwise throw an error
8-
---@see https://github.com/iamcco/markdown-preview.nvim/issues/690
9-
---@see https://github.com/iamcco/markdown-preview.nvim/issues/695
10-
if not package_manager then error "Missing `yarn` or `npx` in the PATH" end
11-
12-
local cmd = string.format(
13-
"!cd %s && cd app && COREPACK_ENABLE_AUTO_PIN=0 %s install --frozen-lockfile",
14-
plugin.dir,
15-
package_manager
16-
)
17-
18-
vim.cmd(cmd)
19-
end,
4+
build = function() vim.fn["mkdp#util#install"]() end,
205
ft = { "markdown", "markdown.mdx" },
216
cmd = { "MarkdownPreviewToggle", "MarkdownPreview", "MarkdownPreviewStop" },
227
init = function()

0 commit comments

Comments
 (0)