mirror of
https://github.com/SpaceVim/SpaceVim.git
synced 2025-02-09 12:10:05 +08:00
fix(flygrep): put filter context into flygrep buffer
This commit is contained in:
parent
dcbc0b34b8
commit
9111a210a3
@ -496,6 +496,11 @@ local function filter(expr)
|
|||||||
mpt._build_prompt()
|
mpt._build_prompt()
|
||||||
pcall(vim.fn.matchdelete, filter_hi_id)
|
pcall(vim.fn.matchdelete, filter_hi_id)
|
||||||
if expr == '' then
|
if expr == '' then
|
||||||
|
-- if the mpt is empty, put context in filter_file into flygrep buffer
|
||||||
|
if vim.fn.filereadable(filter_file) then
|
||||||
|
vim.api.nvim_buf_set_lines(buffer_id, 0, -1, false, vim.fn.readfile(filter_file, ''))
|
||||||
|
vim.cmd('redraw')
|
||||||
|
end
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
filter_hi_id = matchadd('FlygrepFilterPattern', expr_to_pattern(expr), 2)
|
filter_hi_id = matchadd('FlygrepFilterPattern', expr_to_pattern(expr), 2)
|
||||||
|
Loading…
Reference in New Issue
Block a user