Skip to content

fix oops #2126

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jun 21, 2025
Merged

fix oops #2126

merged 2 commits into from
Jun 21, 2025

Conversation

phanen
Copy link
Contributor

@phanen phanen commented Jun 21, 2025

  • fix: typo
  • feat(history): ts highlight on search regex

I should have push this (search_history broken) but on wrong local branch...

@ibhagwan ibhagwan merged commit d598d56 into ibhagwan:main Jun 21, 2025
6 checks passed
@ibhagwan
Copy link
Owner

Something is still off, ts he for search is botched and fzf loading indicator never stops spinning.

IMG_3420

@phanen
Copy link
Contributor Author

phanen commented Jun 21, 2025

I missed this, but I cannot reproduce the spinner issue.

diff --git a/lua/fzf-lua/win.lua b/lua/fzf-lua/win.lua
index 2ea14c7..b40ecd1 100644
--- a/lua/fzf-lua/win.lua
+++ b/lua/fzf-lua/win.lua
@@ -898,7 +898,7 @@ function FzfWin:treesitter_attach()
           -- line:col:text        (grep_curbuf)
           -- line<U+00A0>text     (lines|blines)
           ---@diagnostic disable-next-line: unused-local
-          local filepath, _lnum, text = line_parser(line:sub(min_col))
+          local filepath, _lnum, text, _ft = line_parser(line:sub(min_col))
           if not text or text == 0 then return end
 
           text = text:gsub("^%d+:", "") -- remove col nr if exists
@@ -916,8 +916,8 @@ function FzfWin:treesitter_attach()
             end
           end)()
 
-          local ft = ft_bufnr and vim.bo[tonumber(ft_bufnr)].ft
-              or vim.filetype.match({ filename = path.tail(filepath) })
+          local ft = _ft or (ft_bufnr and vim.bo[tonumber(ft_bufnr)].ft
+            or vim.filetype.match({ filename = path.tail(filepath) }))
           if not ft then return end
 
           local lang = vim.treesitter.language.get_lang(ft)

@ibhagwan
Copy link
Owner

I missed this, but I cannot reproduce the spinner issue.

This was happening if the last bulk is partial, e.g you have history of 600, the last bulk would be 100 and count never gets to 0.

fixed in 037ba12.

@ibhagwan
Copy link
Owner

7af7336

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants