From b2bb63b1002c7cbe4f8ffef6ba5f3b1aa1166bc1 Mon Sep 17 00:00:00 2001 From: wsdjeg Date: Sun, 18 Jun 2023 21:19:29 +0800 Subject: [PATCH] perf(flygrep): improve quickfix support --- autoload/SpaceVim/plugins/scrollbar.vim | 2 +- lua/spacevim/plugin/flygrep.lua | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/autoload/SpaceVim/plugins/scrollbar.vim b/autoload/SpaceVim/plugins/scrollbar.vim index 9f231898f..a43a9d719 100644 --- a/autoload/SpaceVim/plugins/scrollbar.vim +++ b/autoload/SpaceVim/plugins/scrollbar.vim @@ -24,7 +24,7 @@ let s:default = { \ 'min_size' : 3, \ 'width' : 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' : { \ 'head' : '▲', \ 'body' : '█', diff --git a/lua/spacevim/plugin/flygrep.lua b/lua/spacevim/plugin/flygrep.lua index 89f73d3b3..24e2fb6e1 100644 --- a/lua/spacevim/plugin/flygrep.lua +++ b/lua/spacevim/plugin/flygrep.lua @@ -440,6 +440,8 @@ local function apply_to_quickfix() mpt._handle_fly = flygrep if vim.fn.getbufline(buffer_id, 1)[1] ~= '' then if grepid ~= 0 then + -- stop job, and skip callback function + grepid = 0 jobstop(grepid) end mpt._quit = true @@ -464,7 +466,8 @@ local function apply_to_quickfix() lines = searching_result, }) mpt._clear_prompt() - vim.cmd('copen') + -- use botright to make sure quicfix windows width same as screen + vim.cmd('botright copen') end vim.cmd('noautocmd normal! :') end