Skip to content

Commit 37a2452

Browse files
yilisharcsibhagwan
authored andcommitted
feat: Replace local buf global mark output with highlighted text
Commit 4cb7d7c didn't fully address the github issue Addresses #2353
1 parent 1f52c26 commit 37a2452

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

lua/fzf-lua/providers/nvim.lua

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -271,12 +271,17 @@ M.marks = function(opts)
271271

272272
-- global marks
273273
for _, m in ipairs(vim.fn.getmarklist()) do
274-
local mark, lnum, col, file = m.mark:sub(2, 2), m.pos[2], m.pos[3], m.file
274+
local mark, bufnr, lnum, col, file = m.mark:sub(2, 2), m.pos[1], m.pos[2], m.pos[3], m.file
275275
file = path.relative_to(file, uv.cwd())
276276
if path.is_absolute(file) then
277277
file = path.HOME_to_tilde(file)
278278
end
279-
add_mark(mark, lnum, col, file or "-invalid-")
279+
if bufnr == utils.CTX().bufnr then
280+
local text = vim.api.nvim_buf_get_lines(bufnr, lnum - 1, lnum, false)[1]
281+
add_mark(mark, lnum, col, utils.ansi_from_hl("Directory", text or "-invalid-"))
282+
else
283+
add_mark(mark, lnum, col, file or "-invalid-")
284+
end
280285
end
281286

282287
if opts.sort then

0 commit comments

Comments
 (0)