1
0
mirror of https://github.com/SpaceVim/SpaceVim.git synced 2025-01-23 13:10:04 +08:00

perf(flygrep): improve quickfix support

This commit is contained in:
wsdjeg 2023-06-18 21:19:29 +08:00
parent 5f20e4710b
commit b2bb63b100
2 changed files with 5 additions and 2 deletions

View File

@ -24,7 +24,7 @@ let s:default = {
\ 'min_size' : 3, \ 'min_size' : 3,
\ 'width' : 1, \ 'width' : 1,
\ 'right_offset' : 1, \ 'right_offset' : 1,
\ 'excluded_filetypes' : ['startify', 'git-commit','leaderf', 'NvimTree', 'tagbar', 'defx'], \ 'excluded_filetypes' : ['startify', 'git-commit','leaderf', 'NvimTree', 'tagbar', 'defx', 'neo-tree', 'qf'],
\ 'shape' : { \ 'shape' : {
\ 'head' : '▲', \ 'head' : '▲',
\ 'body' : '█', \ 'body' : '█',

View File

@ -440,6 +440,8 @@ local function apply_to_quickfix()
mpt._handle_fly = flygrep mpt._handle_fly = flygrep
if vim.fn.getbufline(buffer_id, 1)[1] ~= '' then if vim.fn.getbufline(buffer_id, 1)[1] ~= '' then
if grepid ~= 0 then if grepid ~= 0 then
-- stop job, and skip callback function
grepid = 0
jobstop(grepid) jobstop(grepid)
end end
mpt._quit = true mpt._quit = true
@ -464,7 +466,8 @@ local function apply_to_quickfix()
lines = searching_result, lines = searching_result,
}) })
mpt._clear_prompt() mpt._clear_prompt()
vim.cmd('copen') -- use botright to make sure quicfix windows width same as screen
vim.cmd('botright copen')
end end
vim.cmd('noautocmd normal! :') vim.cmd('noautocmd normal! :')
end end