mirror of
https://github.com/neovim/neovim.git
synced 2025-10-02 07:58:35 +00:00
refactor(signcol): smarter invalidation (#17533)
Previously b_signcols was invalidated whenever a sign was added/removed or when a buffer line was added/removed. This change introduces a sentinel linenr_T into the buffer state which is a line number used to determine the signcolumn. With this information, we can invalidate the signcolumn less often. Now the signcolumn is only invalidated when a sign or line at the sentinel line number is removed.
This commit is contained in:
@@ -862,9 +862,12 @@ struct file_buffer {
|
||||
// may use a different synblock_T.
|
||||
|
||||
sign_entry_T *b_signlist; // list of placed signs
|
||||
int b_signcols; // last calculated number of sign columns
|
||||
bool b_signcols_valid; // calculated sign columns is valid
|
||||
int b_signcols_max; // Maximum value b_signcols is valid for.
|
||||
struct {
|
||||
int size; // last calculated number of sign columns
|
||||
bool valid; // calculated sign columns is valid
|
||||
linenr_T sentinel; // a line number which is holding up the signcolumn
|
||||
int max; // Maximum value size is valid for.
|
||||
} b_signcols;
|
||||
|
||||
Terminal *terminal; // Terminal instance associated with the buffer
|
||||
|
||||
|
Reference in New Issue
Block a user