Closed n0bra1n3r closed 1 year ago
Here is a feasible workaround. Create a file ~/.config/nvim/ftplugin/qf.lua
with the code below
local bqf = require('bqf')
local preview_enabled = true
vim.api.nvim_create_autocmd({ "CursorMoved" }, {
buffer = vim.fn.bufnr(),
callback = function()
if vim.fn.foldlevel('.') > 0 and preview_enabled then
preview_enabled = bqf.hidePreviewWindow()
elseif not preview_enabled then
preview_enabled = bqf.showPreviewWindow()
end
end
})
From the default keymap, you will be aware of bqf doesn't suggest users use fold in qf window. However, users can change the keymap and fold lines by themselves. Back to this issue, I think @rockyzhang24 's script should work for you, bqf doesn't support this feature until finding a workflow combined with the fold feature.
Feature description
I'm using
foldexpr
to fold messages in the quickfix window. Currently, moving the cursor over the folds shows a preview window for the first/last entries in the fold (depending on which direction the cursor came from). It would be good if there was a way to disable showing the preview window if the current line is a fold.Describe the solution you'd like
Add a configuration to disable preview for folded lines. Optionally, allow showing a preview for only the first line contained in the fold, if that's possible.
Additional context
No response