aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/api/vim.c
diff options
context:
space:
mode:
authorBjörn Linse <bjorn.linse@gmail.com>2020-11-08 11:36:47 +0100
committerBjörn Linse <bjorn.linse@gmail.com>2020-11-21 11:24:14 +0100
commita4986ab47f4561ca82581b1a5f7c21004b05cee9 (patch)
tree1e385debd9f2dd9b1389bf57498c64e9e3cd0e8f /src/nvim/api/vim.c
parent480b04122e93826bdfc74fbeacab2d94b089420f (diff)
downloadrneovim-a4986ab47f4561ca82581b1a5f7c21004b05cee9.tar.gz
rneovim-a4986ab47f4561ca82581b1a5f7c21004b05cee9.tar.bz2
rneovim-a4986ab47f4561ca82581b1a5f7c21004b05cee9.zip
decorations: allow nvim_set_hl to break existing links
also add `default` flag to NOT break existing links/defs
Diffstat (limited to 'src/nvim/api/vim.c')
-rw-r--r--src/nvim/api/vim.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/nvim/api/vim.c b/src/nvim/api/vim.c
index cf822782d8..710885d295 100644
--- a/src/nvim/api/vim.c
+++ b/src/nvim/api/vim.c
@@ -212,6 +212,9 @@ Dictionary nvim__get_hl_defs(Integer ns_id, Error *err)
/// @param ns_id number of namespace for this highlight
/// @param name highlight group name, like ErrorMsg
/// @param val highlight definiton map, like |nvim_get_hl_by_name|.
+/// in addition the following keys are also recognized:
+/// `default`: don't override existing definition,
+/// like `hi default`
/// @param[out] err Error details, if any
///
/// TODO: ns_id = 0, should modify :highlight namespace
@@ -249,7 +252,7 @@ void nvim_set_hl_ns(Integer ns_id, Error *err)
// event path for redraws caused by "fast" events. This could tie in with
// better throttling of async events causing redraws, such as non-batched
// nvim_buf_set_extmark calls from async contexts.
- if (!updating_screen && !ns_hl_changed) {
+ if (!provider_active && !ns_hl_changed) {
multiqueue_put(main_loop.events, on_redraw_event, 0);
}
ns_hl_changed = true;