mirror of
https://github.com/SpaceVim/SpaceVim.git
synced 2025-02-09 14:10:04 +08:00
fix(flygrep): fix flygrep matchadd function
This commit is contained in:
parent
068a704593
commit
d2bed7d333
@ -224,7 +224,8 @@ local function grep_timer(...)
|
|||||||
end
|
end
|
||||||
|
|
||||||
local function matchadd(group, pattern, p)
|
local function matchadd(group, pattern, p)
|
||||||
pcall(vim.fn.matchadd, group, pattern, p)
|
local ok, id = pcall(vim.fn.matchadd, group, pattern, p)
|
||||||
|
return id
|
||||||
end
|
end
|
||||||
|
|
||||||
local function expr_to_pattern(expr)
|
local function expr_to_pattern(expr)
|
||||||
@ -493,10 +494,10 @@ end
|
|||||||
|
|
||||||
local function filter(expr)
|
local function filter(expr)
|
||||||
mpt._build_prompt()
|
mpt._build_prompt()
|
||||||
|
pcall(vim.fn.matchdelete, hi_id)
|
||||||
if expr == '' then
|
if expr == '' then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
pcall(vim.fn.matchdelete, hi_id)
|
|
||||||
vim.cmd('hi def link FlyGrepPattern MoreMsg')
|
vim.cmd('hi def link FlyGrepPattern MoreMsg')
|
||||||
hi_id = matchadd('FlyGrepPattern', expr_to_pattern(expr), 2)
|
hi_id = matchadd('FlyGrepPattern', expr_to_pattern(expr), 2)
|
||||||
grep_expr = expr
|
grep_expr = expr
|
||||||
|
Loading…
Reference in New Issue
Block a user