From 860fea1a3f880c2da0ac351a9523156bcfc67361 Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Tue, 31 Jan 2023 07:08:23 +0800 Subject: fix(highlight): properly deal with underline mask when listing (#22057) --- src/nvim/highlight_defs.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/nvim/highlight_defs.h') diff --git a/src/nvim/highlight_defs.h b/src/nvim/highlight_defs.h index a4dcf6eb60..95c81ac9db 100644 --- a/src/nvim/highlight_defs.h +++ b/src/nvim/highlight_defs.h @@ -18,8 +18,8 @@ typedef enum { // The next three bits are all underline styles HL_UNDERLINE_MASK = 0x38, HL_UNDERLINE = 0x08, - HL_UNDERDOUBLE = 0x10, - HL_UNDERCURL = 0x18, + HL_UNDERCURL = 0x10, + HL_UNDERDOUBLE = 0x18, HL_UNDERDOTTED = 0x20, HL_UNDERDASHED = 0x28, // 0x30 and 0x38 spare for underline styles -- cgit From 8cb5b995b6e4d86035e6950d92c0c68ab4e46787 Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Sat, 11 Mar 2023 10:05:47 +0800 Subject: vim-patch:9.0.1397: highlight for popupmenu kind and extra cannot be set (#22619) Problem: Highlight for popupmenu kind and extra cannot be set. Solution: Add PmenuKind, PmenuKindSel, PmenuExtra and PmenuExtraSel highlight groups and use them. (Gianmaria Bajo, closes vim/vim#12114) https://github.com/vim/vim/commit/6a7c7749204b256e779c245b1e999bf852ad7b64 Co-authored-by: Gianmaria Bajo --- src/nvim/highlight_defs.h | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/nvim/highlight_defs.h') diff --git a/src/nvim/highlight_defs.h b/src/nvim/highlight_defs.h index 95c81ac9db..a5586659c7 100644 --- a/src/nvim/highlight_defs.h +++ b/src/nvim/highlight_defs.h @@ -100,6 +100,10 @@ typedef enum { HLF_SPL, // SpellLocal HLF_PNI, // popup menu normal item HLF_PSI, // popup menu selected item + HLF_PNK, // popup menu normal item "kind" + HLF_PSK, // popup menu selected item "kind" + HLF_PNX, // popup menu normal item "menu" (extra text) + HLF_PSX, // popup menu selected item "menu" (extra text) HLF_PSB, // popup menu scrollbar HLF_PST, // popup menu scrollbar thumb HLF_TP, // tabpage line @@ -165,6 +169,10 @@ EXTERN const char *hlf_names[] INIT(= { [HLF_SPL] = "SpellLocal", [HLF_PNI] = "Pmenu", [HLF_PSI] = "PmenuSel", + [HLF_PNK] = "PmenuKind", + [HLF_PSK] = "PmenuKindSel", + [HLF_PNX] = "PmenuExtra", + [HLF_PSX] = "PmenuExtraSel", [HLF_PSB] = "PmenuSbar", [HLF_PST] = "PmenuThumb", [HLF_TP] = "TabLine", -- cgit From f0ac91c58b42ed4f38dea7352d89fd39a88142f4 Mon Sep 17 00:00:00 2001 From: Luuk van Baal Date: Sat, 1 Apr 2023 14:58:52 +0200 Subject: feat(api): evaluate 'statuscolumn' with nvim_eval_statusline() --- src/nvim/highlight_defs.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/nvim/highlight_defs.h') diff --git a/src/nvim/highlight_defs.h b/src/nvim/highlight_defs.h index a5586659c7..f690b57148 100644 --- a/src/nvim/highlight_defs.h +++ b/src/nvim/highlight_defs.h @@ -247,8 +247,8 @@ typedef struct { /// highlight attributes with associated priorities typedef struct { - int attr_id; + int hl_id; int priority; -} HlPriAttr; +} HlPriId; #endif // NVIM_HIGHLIGHT_DEFS_H -- cgit From a6d745865a7f8b17f016b1879ed28376fed7b6b2 Mon Sep 17 00:00:00 2001 From: bfredl Date: Tue, 12 Sep 2023 11:54:36 +0200 Subject: refactor(highlight): merge redundant attr_entries and attr_entry_ids structs An insert-only set now defines a monotonically increasing ordering by itself. It can be used to both lookup the key from index, and vice versa. --- src/nvim/highlight_defs.h | 1 + 1 file changed, 1 insertion(+) (limited to 'src/nvim/highlight_defs.h') diff --git a/src/nvim/highlight_defs.h b/src/nvim/highlight_defs.h index f690b57148..ae58ff8696 100644 --- a/src/nvim/highlight_defs.h +++ b/src/nvim/highlight_defs.h @@ -219,6 +219,7 @@ typedef enum { kHlCombine, kHlBlend, kHlBlendThrough, + kHlInvalid, } HlKind; typedef struct { -- cgit From a2f17e97ec2d3767a978889320c1a9fb3d82d5b0 Mon Sep 17 00:00:00 2001 From: Evgeni Chasnovski Date: Tue, 10 Oct 2023 12:33:30 +0300 Subject: fix(highlight): add `FloatFooter` to 'highlight_defs.h' (#25577) --- src/nvim/highlight_defs.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/nvim/highlight_defs.h') diff --git a/src/nvim/highlight_defs.h b/src/nvim/highlight_defs.h index ae58ff8696..eec5d9c9f4 100644 --- a/src/nvim/highlight_defs.h +++ b/src/nvim/highlight_defs.h @@ -123,6 +123,7 @@ typedef enum { HLF_WBRNC, // Window bars of not-current windows HLF_CU, // Cursor HLF_BTITLE, // Float Border Title + HLF_BFOOTER, // Float Border Footer HLF_COUNT, // MUST be the last one } hlf_T; @@ -192,6 +193,7 @@ EXTERN const char *hlf_names[] INIT(= { [HLF_WBRNC] = "WinBarNC", [HLF_CU] = "Cursor", [HLF_BTITLE] = "FloatTitle", + [HLF_BFOOTER] = "FloatFooter", }); EXTERN int highlight_attr[HLF_COUNT + 1]; // Highl. attr for each context. -- cgit From 5f03a1eaabfc8de2b3a9c666fcd604763f41e152 Mon Sep 17 00:00:00 2001 From: dundargoc Date: Fri, 20 Oct 2023 15:10:33 +0200 Subject: build(lint): remove unnecessary clint.py rules Uncrustify is the source of truth where possible. Remove any redundant checks from clint.py. --- src/nvim/highlight_defs.h | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) (limited to 'src/nvim/highlight_defs.h') diff --git a/src/nvim/highlight_defs.h b/src/nvim/highlight_defs.h index eec5d9c9f4..6277dc0527 100644 --- a/src/nvim/highlight_defs.h +++ b/src/nvim/highlight_defs.h @@ -127,7 +127,7 @@ typedef enum { HLF_COUNT, // MUST be the last one } hlf_T; -EXTERN const char *hlf_names[] INIT(= { +EXTERN const char *hlf_names[] INIT( = { [HLF_8] = "SpecialKey", [HLF_EOB] = "EndOfBuffer", [HLF_TERM] = "TermCursor", @@ -200,18 +200,18 @@ EXTERN int highlight_attr[HLF_COUNT + 1]; // Highl. attr for each context. EXTERN int highlight_attr_last[HLF_COUNT]; // copy for detecting changed groups EXTERN int highlight_user[9]; // User[1-9] attributes EXTERN int highlight_stlnc[9]; // On top of user -EXTERN int cterm_normal_fg_color INIT(= 0); -EXTERN int cterm_normal_bg_color INIT(= 0); -EXTERN RgbValue normal_fg INIT(= -1); -EXTERN RgbValue normal_bg INIT(= -1); -EXTERN RgbValue normal_sp INIT(= -1); +EXTERN int cterm_normal_fg_color INIT( = 0); +EXTERN int cterm_normal_bg_color INIT( = 0); +EXTERN RgbValue normal_fg INIT( = -1); +EXTERN RgbValue normal_bg INIT( = -1); +EXTERN RgbValue normal_sp INIT( = -1); -EXTERN NS ns_hl_global INIT(= 0); // global highlight namespace -EXTERN NS ns_hl_win INIT(= -1); // highlight namespace for the current window -EXTERN NS ns_hl_fast INIT(= -1); // highlight namespace specified in a fast callback -EXTERN NS ns_hl_active INIT(= 0); // currently active/cached namespace +EXTERN NS ns_hl_global INIT( = 0); // global highlight namespace +EXTERN NS ns_hl_win INIT( = -1); // highlight namespace for the current window +EXTERN NS ns_hl_fast INIT( = -1); // highlight namespace specified in a fast callback +EXTERN NS ns_hl_active INIT( = 0); // currently active/cached namespace -EXTERN int *hl_attr_active INIT(= highlight_attr); +EXTERN int *hl_attr_active INIT( = highlight_attr); typedef enum { kHlUnknown, -- cgit From 4f8941c1a5f1ef6caa410feeb52e343db22763ce Mon Sep 17 00:00:00 2001 From: dundargoc Date: Fri, 10 Nov 2023 12:23:42 +0100 Subject: refactor: replace manual header guards with #pragma once It is less error-prone than manually defining header guards. Pretty much all compilers support it even if it's not part of the C standard. --- src/nvim/highlight_defs.h | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'src/nvim/highlight_defs.h') diff --git a/src/nvim/highlight_defs.h b/src/nvim/highlight_defs.h index 6277dc0527..faec66b2bc 100644 --- a/src/nvim/highlight_defs.h +++ b/src/nvim/highlight_defs.h @@ -1,5 +1,4 @@ -#ifndef NVIM_HIGHLIGHT_DEFS_H -#define NVIM_HIGHLIGHT_DEFS_H +#pragma once #include @@ -253,5 +252,3 @@ typedef struct { int hl_id; int priority; } HlPriId; - -#endif // NVIM_HIGHLIGHT_DEFS_H -- cgit From c4afb9788c4f139eb2e3b7aa4d6a6a20b67ba156 Mon Sep 17 00:00:00 2001 From: Luuk van Baal Date: Sat, 11 Nov 2023 00:52:50 +0100 Subject: refactor(sign): move legacy signs to extmarks Problem: The legacy signlist data structures and associated functions are redundant since the introduction of extmark signs. Solution: Store signs defined through the legacy commands in a hashmap, placed signs in the extmark tree. Replace signlist associated functions. Usage of the legacy sign commands should yield no change in behavior with the exception of: - "orphaned signs" are now always removed when the line it is placed on is deleted. This used to depend on the value of 'signcolumn'. - It is no longer possible to place multiple signs with the same identifier in a single group on multiple lines. This will now move the sign instead. Moreover, both signs placed through the legacy sign commands and through |nvim_buf_set_extmark()|: - Will show up in both |sign-place| and |nvim_buf_get_extmarks()|. - Are displayed by increasing sign identifier, left to right. Extmark signs used to be ordered decreasingly as opposed to legacy signs. --- src/nvim/highlight_defs.h | 6 ------ 1 file changed, 6 deletions(-) (limited to 'src/nvim/highlight_defs.h') diff --git a/src/nvim/highlight_defs.h b/src/nvim/highlight_defs.h index faec66b2bc..96a38b752f 100644 --- a/src/nvim/highlight_defs.h +++ b/src/nvim/highlight_defs.h @@ -246,9 +246,3 @@ typedef struct { } ColorItem; #define COLOR_ITEM_INITIALIZER { .attr_id = -1, .link_id = -1, .version = -1, \ .is_default = false, .link_global = false } - -/// highlight attributes with associated priorities -typedef struct { - int hl_id; - int priority; -} HlPriId; -- cgit From 6c14ae6bfaf51415b555e9a6b85d1d280976358d Mon Sep 17 00:00:00 2001 From: dundargoc Date: Mon, 27 Nov 2023 20:27:32 +0100 Subject: refactor: rename types.h to types_defs.h --- src/nvim/highlight_defs.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/nvim/highlight_defs.h') diff --git a/src/nvim/highlight_defs.h b/src/nvim/highlight_defs.h index 96a38b752f..704c798488 100644 --- a/src/nvim/highlight_defs.h +++ b/src/nvim/highlight_defs.h @@ -3,7 +3,7 @@ #include #include "nvim/macros.h" -#include "nvim/types.h" +#include "nvim/types_defs.h" typedef int32_t RgbValue; -- cgit From 79b6ff28ad1204fbb4199b9092f5c578d88cb28e Mon Sep 17 00:00:00 2001 From: dundargoc Date: Tue, 28 Nov 2023 20:31:00 +0100 Subject: refactor: fix headers with IWYU --- src/nvim/highlight_defs.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/nvim/highlight_defs.h') diff --git a/src/nvim/highlight_defs.h b/src/nvim/highlight_defs.h index 704c798488..24070199ee 100644 --- a/src/nvim/highlight_defs.h +++ b/src/nvim/highlight_defs.h @@ -2,7 +2,7 @@ #include -#include "nvim/macros.h" +#include "nvim/macros_defs.h" #include "nvim/types_defs.h" typedef int32_t RgbValue; -- cgit