diff options
author | Bram Moolenaar <Bram@vim.org> | 2021-11-20 13:47:45 +0000 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2021-11-20 13:47:45 +0000 |
commit | 87fd0924e2d85213cc111ee7a5122f92216a37c7 (patch) | |
tree | f2338c0fc69e65e11e66590514a2b6eb40e2e26d /src/libvterm | |
parent | cdf5fdb2948ecdd24c6a1e27ed33dfa847c2b3e4 (diff) | |
download | vim-git-87fd0924e2d85213cc111ee7a5122f92216a37c7.tar.gz |
patch 8.2.3628: looking terminal colors is a bit slowv8.2.3628
Problem: Looking terminal colors is a bit slow.
Solution: Cache the terminal colors. (closes #9130, closes #9058)
Diffstat (limited to 'src/libvterm')
-rw-r--r-- | src/libvterm/include/vterm.h | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/src/libvterm/include/vterm.h b/src/libvterm/include/vterm.h index fe4a6fce8..9873b6d55 100644 --- a/src/libvterm/include/vterm.h +++ b/src/libvterm/include/vterm.h @@ -122,7 +122,12 @@ typedef enum { /** * Mask that can be used to extract the default foreground/background bit. */ - VTERM_COLOR_DEFAULT_MASK = 0x06 + VTERM_COLOR_DEFAULT_MASK = 0x06, + + /** + * If set, indicates that the color is invalid. + */ + VTERM_COLOR_INVALID = 0x08 } VTermColorType; /** @@ -155,6 +160,12 @@ typedef enum { #define VTERM_COLOR_IS_DEFAULT_BG(col) \ (!!((col)->type & VTERM_COLOR_DEFAULT_BG)) +/** + * Returns true if the VTERM_COLOR_INVALID `type` flag is set, indicating + * that the given VTermColor instance is an invalid color. + */ +#define VTERM_COLOR_IS_INVALID(col) (!!((col)->type & VTERM_COLOR_INVALID)) + typedef struct { /** * Tag indicating which member is actually valid. |