stevearc / oil.nvim

Neovim file explorer: edit your filesystem like a buffer
MIT License
3.84k stars 110 forks source link

bug: Could not find oil adapter for scheme #355

Closed compromyse closed 5 months ago

compromyse commented 5 months ago

Did you check the docs and existing issues?

Neovim version (nvim -v)

v0.9.5

Operating system/version

NixOS Unstable

Describe the bug

Opening any file results in

Could not find oil adapter for scheme '/etc/nixos/config/nvim/default.nix://'
E5108: Error executing lua: ...re/nvim/site/pack/packer/start/oil.nvim/lua/oil/util.lua:825: assertion failed!
stack traceback:
        [C]: in function 'assert'
        ...re/nvim/site/pack/packer/start/oil.nvim/lua/oil/util.lua:825: in function 'get_edit_path'
        ...re/nvim/site/pack/packer/start/oil.nvim/lua/oil/init.lua:668: in function 'open_next_entry'
        ...re/nvim/site/pack/packer/start/oil.nvim/lua/oil/init.lua:705: in function <...re/nvim/site/pack/packer/start/oil.nvim/lua/oil/init.lua:550>

What is the severity of this bug?

blocking (cannot use plugin)

Steps To Reproduce

  1. nvim -u repro.lua
  2. Run :lua oil.toggle_float()
  3. Select any file

Expected Behavior

Opens the selected file

Directory structure

Literally anything

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({
            })
        end,
  },
}

local oil = require('oil')
_G.oil = oil
oil.setup {}

require("lazy").setup(plugins, {
  root = root .. "/plugins",
})

Did you check the bug with a clean config?

rasulomaroff commented 5 months ago

I'm experiencing the same issue after the latest update

h3x commented 5 months ago

As a temp fix so i can keep coding, i checked out to tag v2.8.0.

return {
  'stevearc/oil.nvim',
  opts = {},
  dependencies = { 'nvim-tree/nvim-web-devicons' },
  tag = 'v2.8.0',
  config = function()
    require('oil').setup {
      default_file_explorer = true,
      view_options = {
        show_hidden = true,
      },
      float = {
        padding = 2,
        max_width = 60,
        max_height = 30,
        border = 'rounded',
      },
    }
  end,
}
rasulomaroff commented 5 months ago

Not using a float window for oil also fixes the issue

(Meaning that the issue happens for float windows only)

rodhash commented 5 months ago

+1 same issue

julian-meaningfulgigs commented 5 months ago

Glad I'm not the only one 👍 but no biggie. Happens when using the floating window.

DrunkenToast commented 5 months ago

Running into this one as well. Set the tag as well.

stevearc commented 5 months ago

Should be fixed now. Thanks for the report!