From 81b8a91735ad5cd24a6b3137f14a89f19176364f Mon Sep 17 00:00:00 2001 From: Steven Arcangeli Date: Thu, 1 Jan 2026 00:22:21 -0500 Subject: [PATCH] cleanup: remove deprecated trash_command --- .github/workflows/tests.yml | 1 + lua/oil/adapters/files.lua | 11 +------- lua/oil/adapters/files/trash.lua | 44 -------------------------------- lua/oil/config.lua | 8 ------ 4 files changed, 2 insertions(+), 62 deletions(-) delete mode 100644 lua/oil/adapters/files/trash.lua diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 6d0945c..2b62853 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -4,6 +4,7 @@ on: push: branches: - master + - stevearc-* pull_request: branches: - master diff --git a/lua/oil/adapters/files.lua b/lua/oil/adapters/files.lua index 9aa54c3..9785c3a 100644 --- a/lua/oil/adapters/files.lua +++ b/lua/oil/adapters/files.lua @@ -6,7 +6,6 @@ local fs = require("oil.fs") local git = require("oil.git") local log = require("oil.log") local permissions = require("oil.adapters.files.permissions") -local trash = require("oil.adapters.files.trash") local util = require("oil.util") local uv = vim.uv or vim.loop @@ -620,15 +619,7 @@ M.perform_action = function(action, cb) end if config.delete_to_trash then - if config.trash_command then - vim.notify_once( - "Oil now has native support for trash. Remove the `trash_command` from your config to try it out!", - vim.log.levels.WARN - ) - trash.recursive_delete(path, cb) - else - require("oil.adapters.trash").delete_to_trash(path, cb) - end + require("oil.adapters.trash").delete_to_trash(path, cb) else fs.recursive_delete(action.entry_type, path, cb) end diff --git a/lua/oil/adapters/files/trash.lua b/lua/oil/adapters/files/trash.lua deleted file mode 100644 index 5236f5b..0000000 --- a/lua/oil/adapters/files/trash.lua +++ /dev/null @@ -1,44 +0,0 @@ -local config = require("oil.config") -local M = {} - -M.recursive_delete = function(path, cb) - local stdout = {} - local stderr = {} - local cmd - if config.trash_command:find("%s") then - cmd = string.format("%s %s", config.trash_command, vim.fn.shellescape(path)) - else - cmd = { config.trash_command, path } - end - local jid = vim.fn.jobstart(cmd, { - stdout_buffered = true, - stderr_buffered = true, - on_stdout = function(j, output) - stdout = output - end, - on_stderr = function(j, output) - stderr = output - end, - on_exit = function(j, exit_code) - if exit_code == 0 then - cb() - else - cb( - string.format( - "Error moving '%s' to trash:\n stdout: %s\n stderr: %s", - path, - table.concat(stdout, "\n "), - table.concat(stderr, "\n ") - ) - ) - end - end, - }) - if jid == 0 then - cb(string.format("Passed invalid argument '%s' to '%s'", path, config.trash_command)) - elseif jid == -1 then - cb(string.format("'%s' is not executable", config.trash_command)) - end -end - -return M diff --git a/lua/oil/config.lua b/lua/oil/config.lua index b4fca9a..cafa783 100644 --- a/lua/oil/config.lua +++ b/lua/oil/config.lua @@ -224,7 +224,6 @@ default_config.view_options.highlight_filename = nil ---@class oil.Config ---@field adapters table Hidden from SetupOpts ---@field adapter_aliases table Hidden from SetupOpts ----@field trash_command? string Deprecated option that we should clean up soon ---@field silence_scp_warning? boolean Undocumented option ---@field default_file_explorer boolean ---@field columns oil.ColumnSpec[] @@ -403,13 +402,6 @@ local M = {} M.setup = function(opts) opts = opts or {} - if opts.trash_command then - vim.notify( - "[oil.nvim] trash_command is deprecated. Use built-in trash functionality instead (:help oil-trash).\nCompatibility will be removed on 2025-06-01.", - vim.log.levels.WARN - ) - end - local new_conf = vim.tbl_deep_extend("keep", opts, default_config) if not new_conf.use_default_keymaps then new_conf.keymaps = opts.keymaps or {}