mirror of
https://github.com/SpaceVim/SpaceVim.git
synced 2025-03-15 19:45:46 +08:00
fix(flygrep): fix lsp warnings
This commit is contained in:
parent
634ea0a34f
commit
b737573667
@ -64,6 +64,7 @@ local grep_history = {}
|
|||||||
local preview_win_id = -1
|
local preview_win_id = -1
|
||||||
local filter_file = ''
|
local filter_file = ''
|
||||||
|
|
||||||
|
--- @return table # a list of searching pattern history
|
||||||
local function read_histroy()
|
local function read_histroy()
|
||||||
if
|
if
|
||||||
vim.fn.filereadable(vim.fn.expand(vim.g.spacevim_data_dir .. 'SpaceVim/flygrep_history'))
|
vim.fn.filereadable(vim.fn.expand(vim.g.spacevim_data_dir .. 'SpaceVim/flygrep_history'))
|
||||||
@ -75,8 +76,8 @@ local function read_histroy()
|
|||||||
''
|
''
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
if vim.fn.type(_his) == 3 then
|
if type(_his) == table then
|
||||||
return _his
|
return _his or {}
|
||||||
else
|
else
|
||||||
return {}
|
return {}
|
||||||
end
|
end
|
||||||
@ -111,6 +112,8 @@ local function append(t1, t2)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
--- @param expr string # searching pattern
|
||||||
|
--- @return table<string> # searching command
|
||||||
local function get_search_cmd(expr)
|
local function get_search_cmd(expr)
|
||||||
local cmd = { grep_exe }
|
local cmd = { grep_exe }
|
||||||
append(cmd, grep_opt)
|
append(cmd, grep_opt)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user