File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change 406
406
M .not_chat = function (buf , file_name )
407
407
file_name = vim .fn .resolve (file_name )
408
408
local chat_dir = vim .fn .resolve (M .config .chat_dir )
409
+ if vim .fn .has (" win32" ) then
410
+ file_name = file_name :gsub (" \\ " , " /" )
411
+ chat_dir = chat_dir :gsub (" \\ " , " /" )
412
+ end
409
413
if not M .helpers .starts_with (file_name , chat_dir ) then
410
414
return " resolved file (" .. file_name .. " ) not in chat dir (" .. chat_dir .. " )"
411
415
end
@@ -524,7 +528,9 @@ M.prep_chat = function(buf, file_name)
524
528
525
529
-- make last.md a symlink to the last opened chat file
526
530
local last = M .config .chat_dir .. " /last.md"
527
- if file_name ~= last then
531
+ if file_name ~= last and vim .fn .has (" win32" ) then
532
+ os.execute (" pwsh -Noprofile -c New-Item -Force -ItemType SymbolicLink -Path " .. last .. " -Target " .. file_name )
533
+ elseif file_name ~= last then
528
534
os.execute (" ln -sf " .. file_name .. " " .. last )
529
535
end
530
536
end
You can’t perform that action at this time.
0 commit comments