mirror of
https://github.com/neovim/neovim.git
synced 2025-10-26 12:27:24 +00:00
refactor(vim.opt): use local function syntax
This commit is contained in:
@@ -121,7 +121,7 @@ vim.o = setmetatable({}, {
|
|||||||
---@brief ]]
|
---@brief ]]
|
||||||
|
|
||||||
--- Preserves the order and does not mutate the original list
|
--- Preserves the order and does not mutate the original list
|
||||||
local remove_duplicate_values = function(t)
|
local function remove_duplicate_values(t)
|
||||||
local result, seen = {}, {}
|
local result, seen = {}, {}
|
||||||
for _, v in ipairs(t) do
|
for _, v in ipairs(t) do
|
||||||
if not seen[v] then
|
if not seen[v] then
|
||||||
@@ -430,7 +430,7 @@ end)()
|
|||||||
|
|
||||||
--- Handles the '-' operator
|
--- Handles the '-' operator
|
||||||
local remove_value = (function()
|
local remove_value = (function()
|
||||||
local remove_one_item = function(t, val)
|
local function remove_one_item(t, val)
|
||||||
if vim.tbl_islist(t) then
|
if vim.tbl_islist(t) then
|
||||||
local remove_index = nil
|
local remove_index = nil
|
||||||
for i, v in ipairs(t) do
|
for i, v in ipairs(t) do
|
||||||
@@ -477,10 +477,10 @@ local remove_value = (function()
|
|||||||
end
|
end
|
||||||
end)()
|
end)()
|
||||||
|
|
||||||
local create_option_accessor = function(scope)
|
local function create_option_accessor(scope)
|
||||||
local option_mt
|
local option_mt
|
||||||
|
|
||||||
local make_option = function(name, value)
|
local function make_option(name, value)
|
||||||
local info = assert(options_info[name], 'Not a valid option name: ' .. name)
|
local info = assert(options_info[name], 'Not a valid option name: ' .. name)
|
||||||
|
|
||||||
if type(value) == 'table' and getmetatable(value) == option_mt then
|
if type(value) == 'table' and getmetatable(value) == option_mt then
|
||||||
|
|||||||
Reference in New Issue
Block a user