mirror of
https://github.com/SpaceVim/SpaceVim.git
synced 2025-02-14 02:27:58 +08:00
fix(flygrep): fix result count
if no result, count extmark is cleared.
This commit is contained in:
parent
6dbf4eacd4
commit
3829f764fa
@ -42,6 +42,7 @@ local function update_result_count()
|
|||||||
virt_text = { { string.format('%d/%d', line, count), 'Comment' } },
|
virt_text = { { string.format('%d/%d', line, count), 'Comment' } },
|
||||||
virt_text_pos = 'right_align',
|
virt_text_pos = 'right_align',
|
||||||
})
|
})
|
||||||
|
return prompt_count_id
|
||||||
end
|
end
|
||||||
|
|
||||||
local function build_grep_command()
|
local function build_grep_command()
|
||||||
@ -107,7 +108,7 @@ local function grep_timer(t)
|
|||||||
vim.api.nvim_buf_set_lines(result_bufid, 0, -1, false, {})
|
vim.api.nvim_buf_set_lines(result_bufid, 0, -1, false, {})
|
||||||
if prompt_count_id then
|
if prompt_count_id then
|
||||||
pcall(vim.api.nvim_buf_del_extmark, prompt_bufid, extns, prompt_count_id)
|
pcall(vim.api.nvim_buf_del_extmark, prompt_bufid, extns, prompt_count_id)
|
||||||
prompt_count_id = nil
|
prompt_count_id = update_result_count()
|
||||||
end
|
end
|
||||||
search_jobid = job.start(build_grep_command(), {
|
search_jobid = job.start(build_grep_command(), {
|
||||||
on_stdout = function(id, data)
|
on_stdout = function(id, data)
|
||||||
|
Loading…
Reference in New Issue
Block a user