Skip to content

Commit 6d0f1b5

Browse files
committed
fix: win32 detection
1 parent d5fcd00 commit 6d0f1b5

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lua/gp/init.lua

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -405,7 +405,7 @@ end
405405
M.not_chat = function(buf, file_name)
406406
file_name = vim.fn.resolve(file_name)
407407
local chat_dir = vim.fn.resolve(M.config.chat_dir)
408-
if vim.fn.has("win32") then
408+
if vim.fn.has("win32") == 1 then
409409
file_name = file_name:gsub("\\", "/")
410410
chat_dir = chat_dir:gsub("\\", "/")
411411
end
@@ -527,7 +527,7 @@ M.prep_chat = function(buf, file_name)
527527

528528
-- make last.md a symlink to the last opened chat file
529529
local last = M.config.chat_dir .. "/last.md"
530-
if file_name ~= last and vim.fn.has("win32") then
530+
if file_name ~= last and vim.fn.has("win32") == 1 then
531531
os.execute("pwsh -Noprofile -c New-Item -Force -ItemType SymbolicLink -Path " .. last .. " -Target " .. file_name)
532532
elseif file_name ~= last then
533533
os.execute("ln -sf " .. file_name .. " " .. last)

0 commit comments

Comments
 (0)