mirror of
https://github.com/LazyVim/LazyVim.git
synced 2025-06-21 16:39:06 +02:00
fix(grug-far): only prefill files filter when file has an extension. Closes #4130
This commit is contained in:
parent
fca038b433
commit
6411ab0897
1 changed files with 4 additions and 2 deletions
|
@ -139,9 +139,11 @@ return {
|
||||||
if is_visual then -- needed to make visual selection work
|
if is_visual then -- needed to make visual selection work
|
||||||
vim.cmd([[normal! v]])
|
vim.cmd([[normal! v]])
|
||||||
end
|
end
|
||||||
local grug = require("grug-far");
|
local grug = require("grug-far")
|
||||||
|
local ext = vim.bo.buftype == "" and vim.fn.expand("%:e")
|
||||||
|
local filesFilter = ext and ext ~= "" and "*." .. ext or nil;
|
||||||
(is_visual and grug.with_visual_selection or grug.grug_far)({
|
(is_visual and grug.with_visual_selection or grug.grug_far)({
|
||||||
prefills = { filesFilter = "*." .. vim.fn.expand("%:e") },
|
prefills = { filesFilter = filesFilter },
|
||||||
})
|
})
|
||||||
end,
|
end,
|
||||||
mode = { "n", "v" },
|
mode = { "n", "v" },
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue