aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJosh Rahm <joshuarahm@gmail.com>2023-01-25 18:46:56 +0000
committerJosh Rahm <joshuarahm@gmail.com>2023-01-25 18:46:56 +0000
commit726d6269a68a89ca79cb995492a5cc5e0361e721 (patch)
tree53ddb0645e09cce389d820c1c9de656efca4dd2f
parentd6ccb60a1c75f49255940009abd3bb740bb461af (diff)
parent9837de570c5972f98e74848edc97c297a13136ea (diff)
downloadrneovim-726d6269a68a89ca79cb995492a5cc5e0361e721.tar.gz
rneovim-726d6269a68a89ca79cb995492a5cc5e0361e721.tar.bz2
rneovim-726d6269a68a89ca79cb995492a5cc5e0361e721.zip
Merge branch 'colorcolchar' into 20230125_mix
-rw-r--r--runtime/doc/options.txt5
-rw-r--r--src/nvim/buffer_defs.h1
-rw-r--r--src/nvim/drawline.c2
-rw-r--r--src/nvim/screen.c1
-rw-r--r--test/functional/ui/highlight_spec.lua7
5 files changed, 12 insertions, 4 deletions
diff --git a/runtime/doc/options.txt b/runtime/doc/options.txt
index 293f9ddc80..2bd976fa43 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'. >
@@ -2501,6 +2502,7 @@ A jump table for the options with a short description can be found at |Q_op|.
diff '-' deleted lines of the 'diff' option
msgsep ' ' message separator 'display'
eob '~' empty lines at the end of a buffer
+ colorcol ' ' character to display in the colorcolumn
lastline '@' 'display' contains lastline/truncate
Any one that is omitted will fall back to the default. For "stl" and
@@ -2539,6 +2541,7 @@ A jump table for the options with a short description can be found at |Q_op|.
fold Folded |hl-Folded|
diff DiffDelete |hl-DiffDelete|
eob EndOfBuffer |hl-EndOfBuffer|
+ colorcol:c ColorColumn |hl-ColorColumn|
lastline NonText |hl-NonText|
*'fixendofline'* *'fixeol'* *'nofixendofline'* *'nofixeol'*
diff --git a/src/nvim/buffer_defs.h b/src/nvim/buffer_defs.h
index 081c598966..e57e08ace2 100644
--- a/src/nvim/buffer_defs.h
+++ b/src/nvim/buffer_defs.h
@@ -1177,6 +1177,7 @@ struct window_S {
int diff;
int msgsep;
int eob;
+ int colorcol;
int lastline;
} w_p_fcs_chars;
diff --git a/src/nvim/drawline.c b/src/nvim/drawline.c
index e24d86b353..28f19a95e0 100644
--- a/src/nvim/drawline.c
+++ b/src/nvim/drawline.c
@@ -2521,6 +2521,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 2002f554d4..83ca32e0e9 100644
--- a/src/nvim/screen.c
+++ b/src/nvim/screen.c
@@ -885,6 +885,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", ' ' },
{ &wp->w_p_fcs_chars.lastline, "lastline", '@' },
};
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)