diff options
author | Josh Rahm <joshuarahm@gmail.com> | 2023-01-14 23:21:29 -0700 |
---|---|---|
committer | Josh Rahm <joshuarahm@gmail.com> | 2023-01-14 23:21:29 -0700 |
commit | 451985e92c56f09f50ac5bc6a056965f8c254fc5 (patch) | |
tree | ff2f71bc356e433fa9aa621e024f0b827263c89c | |
parent | 3e0218e7a0c47e2ce0aad11b635944cdd9b75c65 (diff) | |
parent | 9cd203045963095d16e17504aad76d3518d8d826 (diff) | |
download | rneovim-451985e92c56f09f50ac5bc6a056965f8c254fc5.tar.gz rneovim-451985e92c56f09f50ac5bc6a056965f8c254fc5.tar.bz2 rneovim-451985e92c56f09f50ac5bc6a056965f8c254fc5.zip |
Merge branch 'colorcolchar' into HEAD
-rw-r--r-- | runtime/doc/options.txt | 5 | ||||
-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 | ||||
-rw-r--r-- | test/functional/ui/highlight_spec.lua | 7 |
5 files changed, 12 insertions, 4 deletions
diff --git a/runtime/doc/options.txt b/runtime/doc/options.txt index 0571b6589f..b77460a2a9 100644 --- a/runtime/doc/options.txt +++ b/runtime/doc/options.txt @@ -1371,7 +1371,8 @@ A jump table for the options with a short description can be found at |Q_op|. 'colorcolumn' 'cc' string (default "") local to window 'colorcolumn' is a comma-separated list of screen columns that are - highlighted with ColorColumn |hl-ColorColumn|. Useful to align + highlighted with ColorColumn |hl-ColorColumn| and drawn using the + "colorcol" option from 'fillchars'. Useful to align text. Will make screen redrawing slower. The screen column can be an absolute number, or a number preceded with '+' or '-', which is added to or subtracted from 'textwidth'. > @@ -2502,6 +2503,7 @@ A jump table for the options with a short description can be found at |Q_op|. msgsep ' ' message separator 'display' eob '~' empty lines at the end of a buffer lastline '@' 'display' contains lastline/truncate + colorcol:c ' ' character to display in the colorcolumn Any one that is omitted will fall back to the default. For "stl" and "stlnc" the space will be used when there is highlighting, '^' or '=' @@ -2540,6 +2542,7 @@ A jump table for the options with a short description can be found at |Q_op|. diff DiffDelete |hl-DiffDelete| eob EndOfBuffer |hl-EndOfBuffer| lastline NonText |hl-NonText| + colorcol:c ColorColumn |hl-ColorColumn| *'fixendofline'* *'fixeol'* *'nofixendofline'* *'nofixeol'* 'fixendofline' 'fixeol' boolean (default on) diff --git a/src/nvim/buffer_defs.h b/src/nvim/buffer_defs.h index e2c93f481d..6072e42263 100644 --- a/src/nvim/buffer_defs.h +++ b/src/nvim/buffer_defs.h @@ -1178,6 +1178,7 @@ struct window_S { int msgsep; int eob; int lastline; + int colorcol; } w_p_fcs_chars; // "w_topline", "w_leftcol" and "w_skipcol" specify the offsets for diff --git a/src/nvim/drawline.c b/src/nvim/drawline.c index 8fc1a4b029..18ab1e4a4b 100644 --- a/src/nvim/drawline.c +++ b/src/nvim/drawline.c @@ -2502,6 +2502,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 da34cced31..8efe334122 100644 --- a/src/nvim/screen.c +++ b/src/nvim/screen.c @@ -882,6 +882,7 @@ char *set_chars_option(win_T *wp, char **varp, bool apply) { &wp->w_p_fcs_chars.msgsep, "msgsep", ' ' }, { &wp->w_p_fcs_chars.eob, "eob", '~' }, { &wp->w_p_fcs_chars.lastline, "lastline", '@' }, + { &wp->w_p_fcs_chars.colorcol, "colorcol", ' ' }, }; struct chars_tab lcs_tab[] = { diff --git a/test/functional/ui/highlight_spec.lua b/test/functional/ui/highlight_spec.lua index 288c2a214f..61abe341c7 100644 --- a/test/functional/ui/highlight_spec.lua +++ b/test/functional/ui/highlight_spec.lua @@ -859,13 +859,14 @@ describe('CursorLine and CursorLineNr highlights', function() | ]]) + command('set fillchars=colorcol:.') command('set colorcolumn=3') feed('i <esc>') screen:expect([[ - {1:{} {7: } | + {1:{} {7:.} | "{2:a}{7:"} : {3:abc} {3:// 10;} | - {1:}} {7: } | - {5: ^ }{7: }{5: }| + {1:}} {7:.} | + {5: ^ }{7:.}{5: }| | ]]) end) |