diff --git a/lua/astrocommunity/media/codesnap-nvim/README.md b/lua/astrocommunity/media/codesnap-nvim/README.md index 3a368da9c..01e815a1c 100644 --- a/lua/astrocommunity/media/codesnap-nvim/README.md +++ b/lua/astrocommunity/media/codesnap-nvim/README.md @@ -3,3 +3,9 @@ 📸 Snapshot plugin with rich features that can make pretty code snapshots for Neovim **Repository:** + +> [!NOTE] **Windows Support:** +> +> The latest version of CodeSnap does not support Windows. If you are a Windows user, this plugin will pin the latest compatible version, which is **0.0.11**. +> +> _Note_: If you already have a version of this plugin installed on your computer, make sure to delete the current version by running the following command: `:Lazy clean codesnap.nvim` diff --git a/lua/astrocommunity/media/codesnap-nvim/init.lua b/lua/astrocommunity/media/codesnap-nvim/init.lua index f74eab418..f77fbdc15 100644 --- a/lua/astrocommunity/media/codesnap-nvim/init.lua +++ b/lua/astrocommunity/media/codesnap-nvim/init.lua @@ -1,8 +1,12 @@ +-- TODO: Remove extra version checking when CodeSnap adds Windows compatibility. local prefix = "c" +local is_windows = vim.fn.has "win32" ~= 0 return { "mistricky/codesnap.nvim", + version = is_windows and "0.0.11" or nil, -- use the most suitable version for windows users otherwise the latest commit build = "make", - cmd = { "CodeSnap", "CodeSnapSave", "CodeSnapHighlight", "CodeSnapSaveHighlight" }, + cmd = is_windows and "CodeSnapPreviewOn" + or { "CodeSnap", "CodeSnapSave", "CodeSnapHighlight", "CodeSnapSaveHighlight" }, dependencies = { { "AstroNvim/astrocore",