mirror of
https://github.com/neovim/neovim.git
synced 2025-10-09 11:26:37 +00:00
vim-patch:8.1.0632: using sign group names is inefficient
Problem: Using sign group names is inefficient.
Solution: Store group names in a hash table and use a reference to them.
Also remove unnecessary use of ":exe" from the tests. (Yegappan
Lakshmanan, closes vim/vim#3715)
7a2d9892b7
This commit is contained in:
@@ -5,6 +5,17 @@
|
||||
|
||||
// signs: line annotations
|
||||
|
||||
// Sign group
|
||||
typedef struct signgroup_S
|
||||
{
|
||||
uint16_t refcount; // number of signs in this group
|
||||
char_u sg_name[1]; // sign group name
|
||||
} signgroup_T;
|
||||
|
||||
// Macros to get the sign group structure from the group name
|
||||
#define SGN_KEY_OFF offsetof(signgroup_T, sg_name)
|
||||
#define HI2SG(hi) ((signgroup_T *)((hi)->hi_key - SGN_KEY_OFF))
|
||||
|
||||
typedef struct signlist signlist_T;
|
||||
|
||||
struct signlist
|
||||
@@ -12,7 +23,7 @@ struct signlist
|
||||
int id; // unique identifier for each placed sign
|
||||
linenr_T lnum; // line number which has this sign
|
||||
int typenr; // typenr of sign
|
||||
char_u *group; // sign group
|
||||
signgroup_T *group; // sign group
|
||||
int priority; // priority for highlighting
|
||||
signlist_T *next; // next signlist entry
|
||||
signlist_T *prev; // previous entry -- for easy reordering
|
||||
|
Reference in New Issue
Block a user