Skip to content

Commit 7a3daec

Browse files
committed
Add a workaround for people not using the latest neovim verson (0.11).
An error is thrown when using both scope and buf options prior to this version.
1 parent 0cac75a commit 7a3daec

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

lua/neogit/lib/buffer.lua

+6-1
Original file line numberDiff line numberDiff line change
@@ -430,7 +430,12 @@ end
430430

431431
function Buffer:set_buffer_option(name, value)
432432
if self.handle ~= nil then
433-
api.nvim_set_option_value(name, value, { scope = "local", buf = self.handle })
433+
-- TODO: Remove this at some point. Nvim 0.10 throws an error if using both buf and scope
434+
if vim.fn.has("nvim-0.11") == 1 then
435+
api.nvim_set_option_value(name, value, { scope = "local", buf = self.handle })
436+
else
437+
api.nvim_set_option_value(name, value, { buf = self.handle })
438+
end
434439
end
435440
end
436441

0 commit comments

Comments
 (0)