From 393f0dcf82f04de597e194ec120d8cbe6fe212a8 Mon Sep 17 00:00:00 2001 From: Steven Arcangeli Date: Wed, 21 Jun 2023 08:53:11 -0700 Subject: [PATCH] fix!: selecting multiple files only opens buffers, not windows (#111) In an oil buffer you can select multiple entries by highlighting them in visual mode and then calling `oil.select()` (or using a keymap that does so, like `` or ``. Previously we would automatically assume that you wanted to open multiple entries as splits. Now, we treat a default call to `select()` (which is what `` does) as if you simply wanted to open the buffers and keep the same window. This plays nicer with bufferlines. If you want the old behavior, you can explicitly pass in `oil.select({vertical = true})` or use the `` keymap when you have multiple entries selected. --- lua/oil/actions.lua | 2 +- lua/oil/init.lua | 5 ----- 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/lua/oil/actions.lua b/lua/oil/actions.lua index 66b422d..1da95f4 100644 --- a/lua/oil/actions.lua +++ b/lua/oil/actions.lua @@ -194,7 +194,7 @@ M.open_cmdline = { } M.copy_entry_path = { - desc = "Copy the filepath of the entry under the cursor to the + register", + desc = "Yank the filepath of the entry under the cursor to a register", callback = function() local entry = oil.get_cursor_entry() local dir = oil.get_current_dir() diff --git a/lua/oil/init.lua b/lua/oil/init.lua index 0459544..55c68d9 100644 --- a/lua/oil/init.lua +++ b/lua/oil/init.lua @@ -548,11 +548,6 @@ M.select = function(opts) vim.w.oil_entry_id = entry.id vim.api.nvim_set_current_win(prev_win) end - -- Set opts.split so that for every entry after the first, we do a split - opts.split = opts.split or "belowright" - if not opts.horizontal and opts.vertical == nil then - opts.vertical = true - end end if