feat: option to auto-save files affected by will_rename_files (#218)

* save buffers changed by will_rename_files

* prevent closing already open buffers

* chore: move to config option

* chore: fixes

* fix: a crash and some formatting

---------

Co-authored-by: Steven Arcangeli <506791+stevearc@users.noreply.github.com>
This commit is contained in:
Jack Tubbenhauer 2023-12-24 03:00:25 +11:00 committed by GitHub
parent 24027ed8d7
commit 48d8ea8f4a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 45 additions and 3 deletions

View file

@ -38,6 +38,9 @@ local default_config = {
-- 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
cleanup_delay_ms = 2000,
-- Set to true to autosave buffers that are updated with LSP willRenameFiles
-- Set to "unmodified" to only save unmodified buffers
lsp_rename_autosave = 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>",