aboutsummaryrefslogtreecommitdiff
path: root/runtime/lua/vim/_options.lua
diff options
context:
space:
mode:
Diffstat (limited to 'runtime/lua/vim/_options.lua')
-rw-r--r--runtime/lua/vim/_options.lua13
1 files changed, 8 insertions, 5 deletions
diff --git a/runtime/lua/vim/_options.lua b/runtime/lua/vim/_options.lua
index 77d7054626..973ad87ee8 100644
--- a/runtime/lua/vim/_options.lua
+++ b/runtime/lua/vim/_options.lua
@@ -229,10 +229,8 @@ end
--- global value of a |global-local| option, see |:setglobal|.
--- </pre>
---- Get or set |options|. Like `:set`. Invalid key is an error.
----
---- Note: this works on both buffer-scoped and window-scoped options using the
---- current buffer and window.
+--- Get or set |options|. Works like `:set`, so buffer/window-scoped options target the current
+--- buffer/window. Invalid key is an error.
---
--- Example:
---
@@ -690,6 +688,7 @@ local function remove_value(info, current, new)
end
local function create_option_accessor(scope)
+ --- @diagnostic disable-next-line: no-unknown
local option_mt
local function make_option(name, value)
@@ -698,6 +697,7 @@ local function create_option_accessor(scope)
if type(value) == 'table' and getmetatable(value) == option_mt then
assert(name == value._name, "must be the same value, otherwise that's weird.")
+ --- @diagnostic disable-next-line: no-unknown
value = value._value
end
@@ -721,6 +721,7 @@ local function create_option_accessor(scope)
end,
append = function(self, right)
+ --- @diagnostic disable-next-line: no-unknown
self._value = add_value(self._info, self._value, right)
self:_set()
end,
@@ -730,6 +731,7 @@ local function create_option_accessor(scope)
end,
prepend = function(self, right)
+ --- @diagnostic disable-next-line: no-unknown
self._value = prepend_value(self._info, self._value, right)
self:_set()
end,
@@ -739,6 +741,7 @@ local function create_option_accessor(scope)
end,
remove = function(self, right)
+ --- @diagnostic disable-next-line: no-unknown
self._value = remove_value(self._info, self._value, right)
self:_set()
end,
@@ -770,7 +773,7 @@ end
---
---
--- A special interface |vim.opt| exists for conveniently interacting with list-
---- and map-style option from Lua: It allows accessing them as Lua tables and
+--- and map-style options from Lua: It allows accessing them as Lua tables and
--- offers object-oriented method for adding and removing entries.
---
--- Examples: ~