aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/api/vim.c
diff options
context:
space:
mode:
authorLewis Russell <lewis6991@gmail.com>2022-02-21 20:17:36 +0000
committerGitHub <noreply@github.com>2022-02-21 13:17:36 -0700
commit1e7cb2dcd975aadeb91b913f117b21c7775c3374 (patch)
treeb3722c65ecf7062cdfd5d80df98c19fbf80d3c42 /src/nvim/api/vim.c
parentfc7fc14bd2ab1090bd97d1836d3a472ad0ce4f97 (diff)
downloadrneovim-1e7cb2dcd975aadeb91b913f117b21c7775c3374.tar.gz
rneovim-1e7cb2dcd975aadeb91b913f117b21c7775c3374.tar.bz2
rneovim-1e7cb2dcd975aadeb91b913f117b21c7775c3374.zip
fix(highlight): accept NONE as a color name (#17487)
... for when `ns=0`. Also update the documentation of nvim_set_hl to clarify the set behaviour. Fixes #17478
Diffstat (limited to 'src/nvim/api/vim.c')
-rw-r--r--src/nvim/api/vim.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/nvim/api/vim.c b/src/nvim/api/vim.c
index 11bb1750e4..4dc599564f 100644
--- a/src/nvim/api/vim.c
+++ b/src/nvim/api/vim.c
@@ -124,6 +124,10 @@ Dictionary nvim__get_hl_defs(Integer ns_id, Error *err)
/// Set a highlight group.
///
+/// Note: unlike the `:highlight` command which can update a highlight group,
+/// this function completely replaces the definition. For example:
+/// `nvim_set_hl(0, 'Visual', {})` will clear the highlight group 'Visual'.
+///
/// @param ns_id number of namespace for this highlight. Use value 0
/// to set a highlight group in the global (`:highlight`)
/// namespace.