feat: Buffers rework (indicators and sorting) (#208)

This commit is contained in:
Simon Hauser
2020-11-23 16:11:46 +01:00
committed by GitHub
parent 2ac0582c06
commit 863328a96d
6 changed files with 93 additions and 75 deletions

View File

@@ -96,7 +96,15 @@ function actions._goto_file_selection(prompt_bufnr, command)
actions.close(prompt_bufnr)
if entry_bufnr then
vim.cmd(string.format(":%s #%d", command, entry_bufnr))
if command == 'edit' then
vim.cmd(string.format(":buffer %d", entry_bufnr))
elseif command == 'new' then
vim.cmd(string.format(":sbuffer %d", entry_bufnr))
elseif command == 'vnew' then
vim.cmd(string.format(":vert sbuffer %d", entry_bufnr))
elseif command == 'tabedit' then
vim.cmd(string.format(":tab sb %d", entry_bufnr))
end
else
filename = path.normalize(filename, vim.fn.getcwd())