From a0427b3b31b06fe00802781b235db236303df764 Mon Sep 17 00:00:00 2001 From: Cameron Date: Sun, 15 Sep 2024 12:57:46 +0200 Subject: [PATCH] Adds "spell check" to commit message buffer. --- lua/neogit/buffers/editor/init.lua | 1 + lua/neogit/lib/buffer.lua | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/lua/neogit/buffers/editor/init.lua b/lua/neogit/buffers/editor/init.lua index ca3842734..80f832868 100644 --- a/lua/neogit/buffers/editor/init.lua +++ b/lua/neogit/buffers/editor/init.lua @@ -77,6 +77,7 @@ function M:open(kind) name = self.filename, filetype = filetype, load = true, + spell_check = true, buftype = "", kind = kind, modifiable = true, diff --git a/lua/neogit/lib/buffer.lua b/lua/neogit/lib/buffer.lua index 76b7d6647..788566d10 100644 --- a/lua/neogit/lib/buffer.lua +++ b/lua/neogit/lib/buffer.lua @@ -554,6 +554,7 @@ end ---@field user_mappings table|nil ---@field autocmds table|nil ---@field user_autocmds table|nil +---@field spell_check boolean|nil ---@field initialize function|nil ---@field after function|nil ---@field on_detach function|nil @@ -651,7 +652,7 @@ function Buffer.create(config) vim.opt_local.fillchars:append("fold: ") end) - buffer:set_window_option("spell", false) + buffer:set_window_option("spell", config.spell_check or false) buffer:set_window_option("wrap", false) buffer:set_window_option("foldmethod", "manual") -- TODO: Need to find a way to turn this off properly when unloading plugin