mirror of
https://github.com/SpaceVim/SpaceVim.git
synced 2025-04-13 13:19:12 +08:00
perf(flygrep): use noautocmd to update buffer
This commit is contained in:
parent
7a6ffd9524
commit
3be76bca65
@ -164,13 +164,15 @@ local function grep_stdout(id, data, _)
|
||||
if id ~= grepid then
|
||||
return
|
||||
end
|
||||
local datas = vim.fn.filter(data, '!empty(v:val)')
|
||||
-- let datas = s:LIST.uniq_by_func(datas, function('s:file_line'))
|
||||
if vim.fn.getbufline(buffer_id, 1)[1] == '' then
|
||||
vim.api.nvim_buf_set_lines(buffer_id, 0, -1, false, datas)
|
||||
else
|
||||
vim.api.nvim_buf_set_lines(buffer_id, -1, -1, false, datas)
|
||||
end
|
||||
noautocmd(function()
|
||||
local datas = vim.fn.filter(data, '!empty(v:val)')
|
||||
-- let datas = s:LIST.uniq_by_func(datas, function('s:file_line'))
|
||||
if vim.fn.getbufline(buffer_id, 1)[1] == '' then
|
||||
vim.api.nvim_buf_set_lines(buffer_id, 0, -1, false, datas)
|
||||
else
|
||||
vim.api.nvim_buf_set_lines(buffer_id, -1, -1, false, datas)
|
||||
end
|
||||
end)
|
||||
end
|
||||
|
||||
local function grep_stderr(_, data, _)
|
||||
|
Loading…
x
Reference in New Issue
Block a user