From b7748662ed5b06c12a74560690b728fdf770666f Mon Sep 17 00:00:00 2001 From: Michal Liszcz Date: Wed, 29 Mar 2023 09:59:01 +0200 Subject: fix(api): Use local LastSet structure in nvim_get_option_info (#22741) fix(api): use local LastSet structure in nvim_get_option_info * nvim_get_option_info is deprecated. It is always using the global LastSet information as reported in #15232. * nvim_get_option_info2 is added. The new function additionally accepts an 'opts' table {scope, buf, win} allowing to specify the option scope and query local options from another buffer or window. --- src/nvim/api/deprecated.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'src/nvim/api/deprecated.c') diff --git a/src/nvim/api/deprecated.c b/src/nvim/api/deprecated.c index 6a12cfe2da..5937b2f635 100644 --- a/src/nvim/api/deprecated.c +++ b/src/nvim/api/deprecated.c @@ -20,6 +20,7 @@ #include "nvim/highlight_group.h" #include "nvim/lua/executor.h" #include "nvim/memory.h" +#include "nvim/option.h" #include "nvim/pos.h" #include "nvim/types.h" @@ -508,3 +509,16 @@ static int64_t convert_index(int64_t index) { return index < 0 ? index - 1 : index; } + +/// Gets the option information for one option +/// +/// @deprecated Use @ref nvim_get_option_info2 instead. +/// +/// @param name Option name +/// @param[out] err Error details, if any +/// @return Option Information +Dictionary nvim_get_option_info(String name, Error *err) + FUNC_API_SINCE(7) +{ + return get_vimoption(name, OPT_GLOBAL, curbuf, curwin, err); +} -- cgit