diff options
author | Gregory Anders <8965202+gpanders@users.noreply.github.com> | 2023-04-07 08:22:47 -0600 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-04-07 08:22:47 -0600 |
commit | d675bd01b1e78b93e559320b262bdae40b3b54b2 (patch) | |
tree | 2ede624b4ad283bcadebbd26382d7521d6114937 /runtime/plugin/editorconfig.lua | |
parent | 82cfedab5009c0f5003451ef0b105a019887edb3 (diff) | |
download | rneovim-d675bd01b1e78b93e559320b262bdae40b3b54b2.tar.gz rneovim-d675bd01b1e78b93e559320b262bdae40b3b54b2.tar.bz2 rneovim-d675bd01b1e78b93e559320b262bdae40b3b54b2.zip |
feat(lua): allow vim.F.if_nil to take multiple arguments (#22903)
The first argument which is non-nil is returned. This is useful when
using nested default values (e.g. in the EditorConfig plugin).
Before:
local enable = vim.F.if_nil(vim.b.editorconfig, vim.F.if_nil(vim.g.editorconfig, true))
After:
local enable = vim.F.if_nil(vim.b.editorconfig, vim.g.editorconfig, true)
Diffstat (limited to 'runtime/plugin/editorconfig.lua')
-rw-r--r-- | runtime/plugin/editorconfig.lua | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/runtime/plugin/editorconfig.lua b/runtime/plugin/editorconfig.lua index 54cd0e828e..a96919e1fe 100644 --- a/runtime/plugin/editorconfig.lua +++ b/runtime/plugin/editorconfig.lua @@ -3,7 +3,7 @@ vim.api.nvim_create_autocmd({ 'BufNewFile', 'BufRead', 'BufFilePost' }, { group = group, callback = function(args) -- Buffer-local enable has higher priority - local enable = vim.F.if_nil(vim.b.editorconfig, vim.F.if_nil(vim.g.editorconfig, true)) + local enable = vim.F.if_nil(vim.b.editorconfig, vim.g.editorconfig, true) if not enable then return end |