feat(terminal): support theme update notifications (DEC mode 2031) (#31999)

This commit is contained in:
Gregory Anders
2025-01-14 08:18:59 -06:00
committed by GitHub
parent 7eabc8899a
commit f1c45fc7a4
9 changed files with 104 additions and 0 deletions

View File

@@ -44,6 +44,7 @@
#include "nvim/spellfile.h"
#include "nvim/spellsuggest.h"
#include "nvim/strings.h"
#include "nvim/terminal.h"
#include "nvim/types_defs.h"
#include "nvim/vim_defs.h"
#include "nvim/window.h"
@@ -532,6 +533,15 @@ const char *did_set_background(optset_T *args)
check_string_option(&p_bg);
init_highlight(false, false);
}
// Notify all terminal buffers that the background color changed so they can
// send a theme update notification
FOR_ALL_BUFFERS(buf) {
if (buf->terminal) {
terminal_notify_theme(buf->terminal, dark);
}
}
return NULL;
}