oil.nvim icon indicating copy to clipboard operation
oil.nvim copied to clipboard

bug: picker telescope and go to a file it opens in a buffer which was active.

Open Barmanji opened this issue 6 months ago • 0 comments

Did you check the docs and existing issues?

  • [x] I have read the docs
  • [x] I have searched the existing issues

Neovim version (nvim -v)

0.11.2

Operating system/version

Arch Linux Hyprland

Describe the bug

With oil.lua only, Example with 2 buffers:

Image

if i open picker telescope and go to a file it opens in a buffer which was active, but lets take this scenario:

Image

Now here, my left buffer/window is active but I am in Oil/netrw file tree and if I go into a file it will open In right tab/buffer/window. and if both buffer have file tree it chooses right one.

What is the severity of this bug?

tolerable (can work around it)

Steps To Reproduce

  1. have 2 vertically seperated buffer/window in Nvim
  2. open any file in one, and netrw/file tree on one
  3. open picker and go to a file while being active in a file tree one

Expected Behavior

It will open in file one rather than expected active file tree one.

Directory structure

No response

Repro

-- save as repro.lua
-- run with nvim -u repro.lua
-- DO NOT change the paths
local root = vim.fn.fnamemodify("./.repro", ":p")

-- set stdpaths to use .repro
for _, name in ipairs({ "config", "data", "state", "runtime", "cache" }) do
  vim.env[("XDG_%s_HOME"):format(name:upper())] = root .. "/" .. name
end

-- bootstrap lazy
local lazypath = root .. "/plugins/lazy.nvim"
if not vim.loop.fs_stat(lazypath) then
  vim.fn.system({
    "git",
    "clone",
    "--filter=blob:none",
    "--single-branch",
    "https://github.com/folke/lazy.nvim.git",
    lazypath,
  })
end
vim.opt.runtimepath:prepend(lazypath)

-- install plugins
local plugins = {
  "folke/tokyonight.nvim",
  {
        "stevearc/oil.nvim",
        config = function()
            require("oil").setup({
              -- add any needed settings here
            })
        end,
  },
  -- add any other plugins here
}
require("lazy").setup(plugins, {
  root = root .. "/plugins",
})

vim.cmd.colorscheme("tokyonight")
-- add anything else here

Did you check the bug with a clean config?

  • [x] I have confirmed that the bug reproduces with nvim -u repro.lua using the repro.lua file above.

Barmanji avatar Jun 18 '25 18:06 Barmanji