fix: error message too many open files (#432)

and buffer previewer still "erroring" out for builtin.buffers
This commit is contained in:
Simon Hauser
2021-01-19 18:28:47 +01:00
committed by GitHub
parent 7d4d3462e9
commit d75d9ae428
3 changed files with 10 additions and 3 deletions

View File

@@ -259,7 +259,11 @@ previewers.vimgrep = defaulter(function(opts)
local height = vim.api.nvim_win_get_height(win_id)
local p = from_entry.path(entry, true)
if p == nil or p == '' or p == '[No Name]' then return end
if p == nil or p == '' then return end
if entry.bufnr and (p == '[No Name]' or vim.api.nvim_buf_get_option(entry.bufnr, 'buftype') ~= '') then
return
end
local lnum = entry.lnum or 0
local context = math.floor(height / 2)