feat: rename experimental_watch_for_changes -> watch_for_changes

I've been using this for a while now and haven't seen any issues. We can
take "experimental" out of the name.
This commit is contained in:
Steven Arcangeli 2024-07-01 11:34:02 -07:00
parent 65c53dbe4f
commit c7c7ce5bd4
5 changed files with 10 additions and 5 deletions

View file

@ -175,7 +175,7 @@ require("oil").setup({
-- Set to `false` to disable, or "name" to keep it on the file names
constrain_cursor = "editable",
-- Set to true to watch the filesystem for changes and reload oil
experimental_watch_for_changes = false,
watch_for_changes = false,
-- Keymaps in oil buffer. Can be any value that `vim.keymap.set` accepts OR a table of keymap
-- options with a `callback` (e.g. { callback = function() ... end, desc = "", mode = "n" })
-- Additionally, if it is a string that matches "actions.<name>",

View file

@ -65,7 +65,7 @@ CONFIG *oil-confi
-- Set to `false` to disable, or "name" to keep it on the file names
constrain_cursor = "editable",
-- Set to true to watch the filesystem for changes and reload oil
experimental_watch_for_changes = false,
watch_for_changes = false,
-- Keymaps in oil buffer. Can be any value that `vim.keymap.set` accepts OR a table of keymap
-- options with a `callback` (e.g. { callback = function() ... end, desc = "", mode = "n" })
-- Additionally, if it is a string that matches "actions.<name>",

View file

@ -50,7 +50,7 @@ local default_config = {
-- Set to `false` to disable, or "name" to keep it on the file names
constrain_cursor = "editable",
-- Set to true to watch the filesystem for changes and reload oil
experimental_watch_for_changes = false,
watch_for_changes = false,
-- Keymaps in oil buffer. Can be any value that `vim.keymap.set` accepts OR a table of keymap
-- options with a `callback` (e.g. { callback = function() ... end, desc = "", mode = "n" })
-- Additionally, if it is a string that matches "actions.<name>",
@ -207,6 +207,11 @@ M.setup = function(opts)
)
end
-- This option was renamed because it is no longer experimental
if new_conf.experimental_watch_for_changes then
new_conf.watch_for_changes = true
end
for k, v in pairs(new_conf) do
M[k] = v
end

View file

@ -9,7 +9,7 @@
---@field cleanup_delay_ms? integer Oil will automatically delete hidden buffers after this delay. You can set the delay to false to disable cleanup entirely. Note that the cleanup process only starts when none of the oil buffers are currently displayed.
---@field lsp_file_methods? oil.LspFileMethods Configure LSP file operation integration.
---@field constrain_cursor? false|"name"|"editable" Constrain the cursor to the editable parts of the oil buffer. Set to `false` to disable, or "name" to keep it on the file names.
---@field experimental_watch_for_changes? boolean Set to true to watch the filesystem for changes and reload oil.
---@field watch_for_changes? boolean Set to true to watch the filesystem for changes and reload oil.
---@field keymaps? table<string, any>
---@field use_default_keymaps? boolean Set to false to disable all of the above keymaps
---@field view_options? oil.ViewOptions Configure which files are shown and how they are shown.

View file

@ -447,7 +447,7 @@ M.initialize = function(bufnr)
if
adapter
and adapter.name == "files"
and config.experimental_watch_for_changes
and config.watch_for_changes
and not session[bufnr].fs_event
then
local fs_event = assert(uv.new_fs_event())