Skip to content

Commit 6d16a3d

Browse files
authored
Merge branch 'stevearc:master' into feat/rename-move
2 parents 075cc22 + 0fcc838 commit 6d16a3d

7 files changed

Lines changed: 24 additions & 20 deletions

File tree

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -379,6 +379,7 @@ These are plugins maintained by other authors that extend the functionality of o
379379

380380
- [oil-git-status.nvim](https://github.com/refractalize/oil-git-status.nvim) - Shows git status of files in statuscolumn
381381
- [oil-git.nvim](https://github.com/benomahony/oil-git.nvim) - Shows git status of files with colour and symbols
382+
- [oil-git.nvim](https://github.com/malewicz1337/oil-git.nvim) - Async git status integration with directory support
382383
- [oil-lsp-diagnostics.nvim](https://github.com/JezerM/oil-lsp-diagnostics.nvim) - Shows LSP diagnostics indicator as virtual text
383384

384385
## API

doc/oil.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -763,7 +763,7 @@ will be permanently deleted (purged).
763763

764764
Linux:
765765
Oil supports the FreeDesktop trash specification.
766-
https://specifications.freedesktop.org/trash-spec/1.0/
766+
https://specifications.freedesktop.org/trash/1.0/
767767
All features should work.
768768

769769
Mac:

lua/oil/adapters/trash/freedesktop.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
-- Based on the FreeDesktop.org trash specification
2-
-- https://specifications.freedesktop.org/trash-spec/1.0/
2+
-- https://specifications.freedesktop.org/trash/1.0/
33
local cache = require("oil.cache")
44
local config = require("oil.config")
55
local constants = require("oil.constants")

lua/oil/init.lua

Lines changed: 18 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -813,9 +813,6 @@ local function maybe_hijack_directory_buffer(bufnr)
813813
local config = require("oil.config")
814814
local fs = require("oil.fs")
815815
local util = require("oil.util")
816-
if not config.default_file_explorer then
817-
return false
818-
end
819816
local bufname = vim.api.nvim_buf_get_name(bufnr)
820817
if bufname == "" then
821818
return false
@@ -1397,15 +1394,7 @@ M.setup = function(opts)
13971394
vim.w.oil_original_alternate = vim.w[parent_win].oil_original_alternate
13981395
end,
13991396
})
1400-
vim.api.nvim_create_autocmd("BufAdd", {
1401-
desc = "Detect directory buffer and open oil file browser",
1402-
group = aug,
1403-
pattern = "*",
1404-
nested = true,
1405-
callback = function(params)
1406-
maybe_hijack_directory_buffer(params.buf)
1407-
end,
1408-
})
1397+
14091398
-- mksession doesn't save oil buffers in a useful way. We have to manually load them after a
14101399
-- session finishes loading. See https://github.com/stevearc/oil.nvim/issues/29
14111400
vim.api.nvim_create_autocmd("SessionLoadPost", {
@@ -1424,11 +1413,23 @@ M.setup = function(opts)
14241413
end,
14251414
})
14261415

1427-
local bufnr = vim.api.nvim_get_current_buf()
1428-
if maybe_hijack_directory_buffer(bufnr) and vim.v.vim_did_enter == 1 then
1429-
-- manually call load on a hijacked directory buffer if vim has already entered
1430-
-- (the BufReadCmd will not trigger)
1431-
M.load_oil_buffer(bufnr)
1416+
if config.default_file_explorer then
1417+
vim.api.nvim_create_autocmd("BufAdd", {
1418+
desc = "Detect directory buffer and open oil file browser",
1419+
group = aug,
1420+
pattern = "*",
1421+
nested = true,
1422+
callback = function(params)
1423+
maybe_hijack_directory_buffer(params.buf)
1424+
end,
1425+
})
1426+
1427+
local bufnr = vim.api.nvim_get_current_buf()
1428+
if maybe_hijack_directory_buffer(bufnr) and vim.v.vim_did_enter == 1 then
1429+
-- manually call load on a hijacked directory buffer if vim has already entered
1430+
-- (the BufReadCmd will not trigger)
1431+
M.load_oil_buffer(bufnr)
1432+
end
14321433
end
14331434
end
14341435

lua/oil/util.lua

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -582,6 +582,7 @@ M.render_text = function(bufnr, text, opts)
582582
h_align = "center",
583583
v_align = "center",
584584
})
585+
---@cast opts table
585586
if not vim.api.nvim_buf_is_valid(bufnr) then
586587
return
587588
end

lua/oil/view.lua

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -871,6 +871,7 @@ M.render_buffer_async = function(bufnr, opts, callback)
871871
opts = vim.tbl_deep_extend("keep", opts or {}, {
872872
refetch = true,
873873
})
874+
---@cast opts table
874875
if bufnr == 0 then
875876
bufnr = vim.api.nvim_get_current_buf()
876877
end

scripts/generate.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -362,7 +362,7 @@ def get_trash_vimdoc() -> "VimdocSection":
362362
363363
Linux:
364364
Oil supports the FreeDesktop trash specification.
365-
https://specifications.freedesktop.org/trash-spec/1.0/
365+
https://specifications.freedesktop.org/trash/1.0/
366366
All features should work.
367367
368368
Mac:

0 commit comments

Comments
 (0)