fix: preview for unnamed buffers (#434)

This commit is contained in:
Simon Hauser
2021-01-15 16:42:26 +01:00
committed by GitHub
parent e08a5b1331
commit 00e898a1f9
2 changed files with 24 additions and 15 deletions

View File

@@ -259,7 +259,7 @@ 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 == '' then return end
if p == nil or p == '' or p == '[No Name]' then return end
local lnum = entry.lnum or 0
local context = math.floor(height / 2)