Skip to content

Commit

Permalink
fix: handle opening oil from buffers with foreign schemes (#256)
Browse files Browse the repository at this point in the history
  • Loading branch information
stevearc committed Dec 24, 2023
1 parent 71b1ef5 commit 22ab2ce
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions lua/oil/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,11 @@ M.get_buffer_parent_url = function(bufname, use_oil_parent)
return config.adapter_to_scheme.files .. util.addslash(path)
end

-- This is some unknown buffer scheme
if not config.adapters[scheme] then
return vim.fn.getcwd()
end

if not use_oil_parent then
return bufname
end
Expand Down

0 comments on commit 22ab2ce

Please sign in to comment.