1
0
mirror of https://github.com/SpaceVim/SpaceVim.git synced 2025-03-13 02:05:40 +08:00

fix(flygrep): fix lsp warnings

This commit is contained in:
wsdjeg 2023-06-20 21:30:09 +08:00
parent 634ea0a34f
commit b737573667

View File

@ -64,6 +64,7 @@ local grep_history = {}
local preview_win_id = -1
local filter_file = ''
--- @return table # a list of searching pattern history
local function read_histroy()
if
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
return _his
if type(_his) == table then
return _his or {}
else
return {}
end
@ -111,6 +112,8 @@ local function append(t1, t2)
end
end
--- @param expr string # searching pattern
--- @return table<string> # searching command
local function get_search_cmd(expr)
local cmd = { grep_exe }
append(cmd, grep_opt)