Skip to content

Commit c7c7ce5

Browse files
committed
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.
1 parent 65c53db commit c7c7ce5

File tree

5 files changed

+10
-5
lines changed

5 files changed

+10
-5
lines changed

README.md

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

doc/oil.txt

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

lua/oil/config.lua

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ local default_config = {
5050
-- Set to `false` to disable, or "name" to keep it on the file names
5151
constrain_cursor = "editable",
5252
-- Set to true to watch the filesystem for changes and reload oil
53-
experimental_watch_for_changes = false,
53+
watch_for_changes = false,
5454
-- Keymaps in oil buffer. Can be any value that `vim.keymap.set` accepts OR a table of keymap
5555
-- options with a `callback` (e.g. { callback = function() ... end, desc = "", mode = "n" })
5656
-- Additionally, if it is a string that matches "actions.<name>",
@@ -207,6 +207,11 @@ M.setup = function(opts)
207207
)
208208
end
209209

210+
-- This option was renamed because it is no longer experimental
211+
if new_conf.experimental_watch_for_changes then
212+
new_conf.watch_for_changes = true
213+
end
214+
210215
for k, v in pairs(new_conf) do
211216
M[k] = v
212217
end

lua/oil/types.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
---@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.
1010
---@field lsp_file_methods? oil.LspFileMethods Configure LSP file operation integration.
1111
---@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.
12-
---@field experimental_watch_for_changes? boolean Set to true to watch the filesystem for changes and reload oil.
12+
---@field watch_for_changes? boolean Set to true to watch the filesystem for changes and reload oil.
1313
---@field keymaps? table<string, any>
1414
---@field use_default_keymaps? boolean Set to false to disable all of the above keymaps
1515
---@field view_options? oil.ViewOptions Configure which files are shown and how they are shown.

lua/oil/view.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -447,7 +447,7 @@ M.initialize = function(bufnr)
447447
if
448448
adapter
449449
and adapter.name == "files"
450-
and config.experimental_watch_for_changes
450+
and config.watch_for_changes
451451
and not session[bufnr].fs_event
452452
then
453453
local fs_event = assert(uv.new_fs_event())

0 commit comments

Comments
 (0)