Skip to content

Commit 8c7a97b

Browse files
committed
The grep command does not exclude symbolic links in Windows
Fix `ChatToggle` not create new chat
1 parent 09dc879 commit 8c7a97b

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

lua/gp/init.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -808,7 +808,7 @@ M.cmd.ChatToggle = function(params, system_prompt, agent)
808808
if params.range ~= 2 then
809809
-- check if last.md chat file exists and open it
810810
local last = M.config.chat_dir .. "/last.md"
811-
if vim.fn.filereadable(vim.fn.resolve(last)) == 1 and last ~= vim.fn.resolve(last) then
811+
if vim.fn.filereadable(last) == 1 and last ~= vim.fn.resolve(last) then
812812
-- resolve symlink
813813
last = vim.fn.resolve(last)
814814
M.open_buf(last, M.resolve_buf_target(params), M._toggle_kind.chat, true)

lua/gp/tasker.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ M.grep_directory = function(buf, directory, pattern, callback)
193193
-- strip leading and trailing non alphanumeric characters
194194
local re = pattern:gsub("^%W*(.-)%W*$", "%1")
195195

196-
M.run(buf, "grep", { "-irEn", "--null", pattern, directory }, function(c, _, stdout, _)
196+
M.run(buf, "grep", { "-irEn", "--null", "--exclude=last.md", pattern, directory }, function(c, _, stdout, _)
197197
local results = {}
198198
if c ~= 0 then
199199
callback(results, re)

0 commit comments

Comments
 (0)