mirror of
https://github.com/SpaceVim/SpaceVim.git
synced 2025-01-24 06:30:03 +08:00
19 lines
406 B
Lua
19 lines
406 B
Lua
local M = {}
|
|
|
|
function M.setlocalopt(buf, win, opts)
|
|
for o, value in pairs(opts) do
|
|
local info = vim.api.nvim_get_option_info2(o, {})
|
|
if info.scope == 'win' then
|
|
vim.api.nvim_set_option_value(o, value, {
|
|
win = win,
|
|
})
|
|
elseif info.scope == 'buf' then
|
|
vim.api.nvim_set_option_value(o, value, {
|
|
buf = buf,
|
|
})
|
|
end
|
|
end
|
|
end
|
|
|
|
return M
|