diff options
author | Josh Rahm <joshuarahm@gmail.com> | 2023-01-31 23:08:29 +0000 |
---|---|---|
committer | Josh Rahm <joshuarahm@gmail.com> | 2023-01-31 23:08:29 +0000 |
commit | a2e3d22928e127385277c472fef6aff96d238ff2 (patch) | |
tree | 02514aa04b032ab624c09cd7cb8dd1fab131a270 /src/nvim/buffer_defs.h | |
parent | daa55ee86df76dee028947db527a4f999569f5f8 (diff) | |
download | rneovim-a2e3d22928e127385277c472fef6aff96d238ff2.tar.gz rneovim-a2e3d22928e127385277c472fef6aff96d238ff2.tar.bz2 rneovim-a2e3d22928e127385277c472fef6aff96d238ff2.zip |
feat(colorcolchar): make the colorcolumn more flexible
This PR creates the ability to optionally decorate the colorcolumn(s) in
other ways.
Specifically it adds the ability to set:
* The highlight group to highlight a colorcolumn with
* A character to draw in a colorcolumn
* whether the colorcolumn should mix its highlighting with the
character in the column.
The new syntax for colorcolumn is:
set colorcolumn=[+|-]<num>[/<char>[/<hl_group>[/<flags>]]]
By default the char is ' ', and the hl_group is 'ColorColumn'
This PR does not change the existing semantics, just adds to them.
Diffstat (limited to 'src/nvim/buffer_defs.h')
-rw-r--r-- | src/nvim/buffer_defs.h | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/src/nvim/buffer_defs.h b/src/nvim/buffer_defs.h index f01edd1ad2..dfcbb28c69 100644 --- a/src/nvim/buffer_defs.h +++ b/src/nvim/buffer_defs.h @@ -93,6 +93,21 @@ typedef uint64_t disptick_T; // display tick type #include "nvim/syntax_defs.h" #include "nvim/terminal.h" +typedef enum { + kColorcolBehind = 1 +} colorcol_flags_T; + +// Structure to define data associated with a colorcolumn. +typedef struct { + int col; // The column number to highlight. + int ch; // The character to draw in the column. + + char* syn_name; // The highlight group name. Must be free'd. + int syn_attr; // The attribute. Will be set before a redraw. + + int flags; // Additional flags +} colorcol_T; + // The taggy struct is used to store the information about a :tag command. typedef struct taggy { char *tagname; // tag name @@ -1335,7 +1350,7 @@ struct window_S { uint32_t w_p_wbr_flags; // flags for 'winbar' uint32_t w_p_fde_flags; // flags for 'foldexpr' uint32_t w_p_fdt_flags; // flags for 'foldtext' - int *w_p_cc_cols; // array of columns to highlight or NULL + colorcol_T *w_p_cc_cols; // array of columns to highlight or NULL uint8_t w_p_culopt_flags; // flags for cursorline highlighting long w_p_siso; // 'sidescrolloff' local value long w_p_so; // 'scrolloff' local value |