Skip to content

Commit 7af7336

Browse files
committed
fix(search_history): regex ts highlighting (#2126)
1 parent 037ba12 commit 7af7336

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

lua/fzf-lua/win.lua

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -898,7 +898,7 @@ function FzfWin:treesitter_attach()
898898
-- line:col:text (grep_curbuf)
899899
-- line<U+00A0>text (lines|blines)
900900
---@diagnostic disable-next-line: unused-local
901-
local filepath, _lnum, text = line_parser(line:sub(min_col))
901+
local filepath, _lnum, text, _ft = line_parser(line:sub(min_col))
902902
if not text or text == 0 then return end
903903

904904
text = text:gsub("^%d+:", "") -- remove col nr if exists
@@ -916,8 +916,8 @@ function FzfWin:treesitter_attach()
916916
end
917917
end)()
918918

919-
local ft = ft_bufnr and vim.bo[tonumber(ft_bufnr)].ft
920-
or vim.filetype.match({ filename = path.tail(filepath) })
919+
local ft = _ft or (ft_bufnr and vim.bo[tonumber(ft_bufnr)].ft
920+
or vim.filetype.match({ filename = path.tail(filepath) }))
921921
if not ft then return end
922922

923923
local lang = vim.treesitter.language.get_lang(ft)

0 commit comments

Comments
 (0)