diff options
author | Sindre T. Strøm <sindrets@gmail.com> | 2023-03-31 12:52:53 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-03-31 12:52:53 +0200 |
commit | b34097fe6d2ea5c84bcec65a834a430d9f58eb64 (patch) | |
tree | 5437aa065dab04d1772ab15573ae47be584b778e /src/nvim/api/vim.c | |
parent | ed10e4ef60c63d924b9969abdf77adaad506b676 (diff) | |
download | rneovim-b34097fe6d2ea5c84bcec65a834a430d9f58eb64.tar.gz rneovim-b34097fe6d2ea5c84bcec65a834a430d9f58eb64.tar.bz2 rneovim-b34097fe6d2ea5c84bcec65a834a430d9f58eb64.zip |
fix(api): return both link and attributes with nvim_get_hl (#22824)
Problem: No way to get the actual highlight attributes for a linked
group through |nvim_get_hl()| (not the attributes from the link target).
Solution: Return the actual attributes as well as the link target name.
Diffstat (limited to 'src/nvim/api/vim.c')
-rw-r--r-- | src/nvim/api/vim.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/nvim/api/vim.c b/src/nvim/api/vim.c index ca5dd97020..9812313b7b 100644 --- a/src/nvim/api/vim.c +++ b/src/nvim/api/vim.c @@ -95,6 +95,9 @@ Integer nvim_get_hl_id_by_name(String name) /// @param[out] err Error details, if any. /// @return Highlight groups as a map from group name to a highlight definition map as in |nvim_set_hl()|, /// or only a single highlight definition map if requested by name or id. +/// +/// @note When the `link` attribute is defined in the highlight definition +/// map, other attributes will not be taking effect (see |:hi-link|). Dictionary nvim_get_hl(Integer ns_id, Dict(get_highlight) *opts, Arena *arena, Error *err) FUNC_API_SINCE(11) { @@ -113,6 +116,10 @@ Dictionary nvim_get_hl(Integer ns_id, Dict(get_highlight) *opts, Arena *arena, E /// values of the Normal group. If the Normal group has not been defined, /// using these values results in an error. /// +/// +/// @note If `link` is used in combination with other attributes; only the +/// `link` will take effect (see |:hi-link|). +/// /// @param ns_id Namespace id for this highlight |nvim_create_namespace()|. /// Use 0 to set a highlight group globally |:highlight|. /// Highlights from non-global namespaces are not active by default, use |