diff options
author | Josh Rahm <joshuarahm@gmail.com> | 2022-08-27 20:52:08 -0600 |
---|---|---|
committer | Josh Rahm <joshuarahm@gmail.com> | 2022-08-30 23:18:13 -0600 |
commit | 4825baba825a094825e586b829cf981a979282e4 (patch) | |
tree | 216d672d8dd230596be576c639d868b6c8c34e67 /src | |
parent | f4274d0f62625683486d3912dcd6e8e45877c6a4 (diff) | |
download | rneovim-4825baba825a094825e586b829cf981a979282e4.tar.gz rneovim-4825baba825a094825e586b829cf981a979282e4.tar.bz2 rneovim-4825baba825a094825e586b829cf981a979282e4.zip |
feat(colorcolchar): add the option "colorcol" to the fillchars setting
This option will let neovim draw a character in the colorcolumn when
there is no other character occupying that spot.
For example, I'm someone who likes the elegance of seeing a 1px wide line
at the 80 character mark, rather than a rectangle the width of a cell at
that mark. To accomplish this, I run
:set colorcol=80
:set fillchars=colorcol:│
of course ':' and '.' are good ASCII alteratives.
Diffstat (limited to 'src')
-rw-r--r-- | src/nvim/buffer_defs.h | 1 | ||||
-rw-r--r-- | src/nvim/drawline.c | 2 | ||||
-rw-r--r-- | src/nvim/screen.c | 1 |
3 files changed, 4 insertions, 0 deletions
diff --git a/src/nvim/buffer_defs.h b/src/nvim/buffer_defs.h index c1ac20fd98..fbf0cb5ea9 100644 --- a/src/nvim/buffer_defs.h +++ b/src/nvim/buffer_defs.h @@ -1219,6 +1219,7 @@ struct window_S { int diff; int msgsep; int eob; + int colorcol; } w_p_fcs_chars; /* diff --git a/src/nvim/drawline.c b/src/nvim/drawline.c index b6c4400c60..5862f66d72 100644 --- a/src/nvim/drawline.c +++ b/src/nvim/drawline.c @@ -2344,6 +2344,8 @@ int win_line(win_T *wp, linenr_T lnum, int startrow, int endrow, bool nochange, col_attr = cuc_attr; } else if (draw_color_col && VCOL_HLC == *color_cols) { col_attr = mc_attr; + c = wp->w_p_fcs_chars.colorcol; + schar_from_char(linebuf_char[off], c); } col_attr = hl_combine_attr(col_attr, line_attr); diff --git a/src/nvim/screen.c b/src/nvim/screen.c index d268dde845..88aecfad28 100644 --- a/src/nvim/screen.c +++ b/src/nvim/screen.c @@ -1328,6 +1328,7 @@ char *set_chars_option(win_T *wp, char **varp, bool apply) { &wp->w_p_fcs_chars.diff, "diff", '-' }, { &wp->w_p_fcs_chars.msgsep, "msgsep", ' ' }, { &wp->w_p_fcs_chars.eob, "eob", '~' }, + { &wp->w_p_fcs_chars.colorcol, "colorcol", ' ' }, }; struct chars_tab lcs_tab[] = { |