diff options
author | luukvbaal <31730729+luukvbaal@users.noreply.github.com> | 2023-01-09 18:12:06 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-01-09 17:12:06 +0000 |
commit | 364b131f42509326c912c9b0fef5dfc94ed23b41 (patch) | |
tree | 654f24fde95819257002aa9b36990efd6a80535c /src/nvim/buffer_defs.h | |
parent | 50f03773f4b9f4638489ccfd0503dc9e39e5de78 (diff) | |
download | rneovim-364b131f42509326c912c9b0fef5dfc94ed23b41.tar.gz rneovim-364b131f42509326c912c9b0fef5dfc94ed23b41.tar.bz2 rneovim-364b131f42509326c912c9b0fef5dfc94ed23b41.zip |
feat(ui): add 'statuscolumn' option
Problem: Unable to customize the column next to a window ('gutter').
Solution: Add 'statuscolumn' option that follows the 'statusline' syntax,
allowing to customize the status column. Also supporting the %@
click execute function label. Adds new items @C and @s which
will print the fold and sign columns. Line numbers and signs
can be clicked, highlighted, aligned, transformed, margined etc.
Diffstat (limited to 'src/nvim/buffer_defs.h')
-rw-r--r-- | src/nvim/buffer_defs.h | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/src/nvim/buffer_defs.h b/src/nvim/buffer_defs.h index df4ebdffc0..7442e60024 100644 --- a/src/nvim/buffer_defs.h +++ b/src/nvim/buffer_defs.h @@ -204,6 +204,8 @@ typedef struct { #define w_p_cc w_onebuf_opt.wo_cc // 'colorcolumn' char *wo_sbr; #define w_p_sbr w_onebuf_opt.wo_sbr // 'showbreak' + char *wo_stc; +#define w_p_stc w_onebuf_opt.wo_stc // 'statuscolumn' char *wo_stl; #define w_p_stl w_onebuf_opt.wo_stl // 'statusline' char *wo_wbr; @@ -1300,6 +1302,7 @@ struct window_S { linenr_T w_redraw_bot; // when != 0: last line needing redraw bool w_redr_status; // if true statusline/winbar must be redrawn bool w_redr_border; // if true border must be redrawn + bool w_redr_statuscol; // if true 'statuscolumn' must be redrawn // remember what is shown in the ruler for this window (if 'ruler' set) pos_T w_ru_cursor; // cursor position shown in ruler @@ -1404,6 +1407,31 @@ struct window_S { StlClickDefinition *w_winbar_click_defs; // Size of the w_winbar_click_defs array size_t w_winbar_click_defs_size; + + // Status column click definitions + StlClickDefinition *w_statuscol_click_defs; + // Size of the w_statuscol_click_defs array + size_t w_statuscol_click_defs_size; +}; + +/// Struct to hold info for 'statuscolumn' +typedef struct statuscol statuscol_T; + +struct statuscol { + int width; // width of the status column + int cur_attr; // current attributes in text + int num_attr; // attributes used for line number + int fold_attr; // attributes used for fold column + int sign_attr[SIGN_SHOW_MAX]; // attributes used for signs + int truncate; // truncated width + bool draw; // draw statuscolumn or not + char fold_text[10]; // text in fold column (%C) + char *sign_text[SIGN_SHOW_MAX]; // text in sign column (%s) + char text[MAXPATHL]; // text in status column + char *textp; // current position in text + size_t text_len; // length of text + stl_hlrec_t *hlrec; // highlight groups + stl_hlrec_t *hlrecp; // current highlight group }; /// Macros defined in Vim, but not in Neovim |