From b1a632f69b55ad3d5047b4ad83de291210e7fc22 Mon Sep 17 00:00:00 2001 From: Tyler Miller Date: Thu, 16 Mar 2023 16:13:34 -0700 Subject: [PATCH] fix: don't write when writing is disabled globally writing buffers fails/errors when `write` is false acknowledge and follow nvim's `write` option --- lua/sos/impl.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/sos/impl.lua b/lua/sos/impl.lua index f8764f1..a3ec861 100644 --- a/lua/sos/impl.lua +++ b/lua/sos/impl.lua @@ -50,7 +50,6 @@ local err -- when :confirm is used). This flag is set at least on :read and :file. See -- :h not-edited. -- * Use ++p flag to auto create parent dirs? Or prompt? --- * Ensure 'write' is set, otherwise this will prob error with msg!? ---@return nil local function write_current_buf() @@ -79,6 +78,7 @@ end function M.write_buf_if_needed(buf) if vim.bo[buf].mod + and vim.o.write and not vim.bo[buf].ro and api.nvim_buf_is_loaded(buf) and wanted_buftype(buf)