@@ -70,6 +70,10 @@ local function make_ref(path, line_str, col_str, abs_start, abs_end)
7070 }
7171end
7272
73+ local function picker_ref_key (path , line )
74+ return make_absolute_path (path ) .. ' :' .. (line or 0 )
75+ end
76+
7377--- @param text string
7478--- @param message_id string
7579--- @return CodeReference[]
@@ -164,7 +168,7 @@ local function collect_picker_refs()
164168 local c = cache [message_id ]
165169 if c then
166170 for _ , ref in ipairs (c .refs ) do
167- local key = ref .file_path .. ' : ' .. ( ref .line or 0 )
171+ local key = picker_ref_key ( ref .file_path , ref .line )
168172 if not seen [key ] then
169173 seen [key ] = true
170174 table.insert (refs , ref )
@@ -177,10 +181,10 @@ local function collect_picker_refs()
177181 if part .type == ' tool' then
178182 local file_path = vim .tbl_get (part , ' state' , ' input' , ' filePath' )
179183 if file_path and vim .fn .filereadable (file_path ) == 1 then
180- local key = file_path .. ' :0'
184+ local rel = vim .fn .fnamemodify (file_path , ' :~:.' )
185+ local key = picker_ref_key (rel , nil )
181186 if not seen [key ] then
182187 seen [key ] = true
183- local rel = vim .fn .fnamemodify (file_path , ' :~:.' )
184188 table.insert (refs , make_ref (rel , ' ' , ' ' , 0 , 0 ))
185189 end
186190 end
0 commit comments