feat: add buffer list (#30)

NOTE: Buffer entry sometimes uses unstyled window, and I can't figure out why.

* feat: add buffers

* fixup
This commit is contained in:
TJ DeVries
2020-09-05 07:34:38 -04:00
committed by GitHub
parent 4abb5f7867
commit c70d6e58a0
3 changed files with 66 additions and 7 deletions
+22
View File
@@ -169,4 +169,26 @@ function make_entry.gen_from_quickfix(opts)
end
end
function make_entry.gen_from_buffer(opts)
return function(entry)
local bufnr_str = tostring(entry)
local bufname = vim.api.nvim_buf_get_name(entry)
if '' == bufname then
return nil
end
return {
valid = true,
value = bufname,
ordinal = bufnr_str .. " : " .. bufname,
display = bufnr_str .. " : " .. bufname,
bufnr = entry,
filename = bufname,
}
end
end
return make_entry