diff options
author | Marco Hinz <mh.codebro@gmail.com> | 2015-07-18 14:57:58 +0200 |
---|---|---|
committer | Justin M. Keyes <justinkz@gmail.com> | 2015-07-18 16:37:16 -0400 |
commit | 1d4f68a2f5f9536791fb271f9d29287da5875748 (patch) | |
tree | 64af699a46b4ac5ecde99c67819a18c1482af096 | |
parent | 6cfeea992250faec9654b9ff80108e662ce55704 (diff) | |
download | rneovim-1d4f68a2f5f9536791fb271f9d29287da5875748.tar.gz rneovim-1d4f68a2f5f9536791fb271f9d29287da5875748.tar.bz2 rneovim-1d4f68a2f5f9536791fb271f9d29287da5875748.zip |
vim-patch:7.4.667 #3043
Problem: 'colorcolumn' isn't drawn in a closed fold while 'cursorcolumn'
is. (Carlos Pita)
Solution: Make it consistent. (Christian Brabandt)
Original patch:
https://github.com/vim/vim/commit/v7-4-667
Discussion:
https://groups.google.com/forum/#!topic/vim_dev/Lidb7s4xn3Q
-rw-r--r-- | src/nvim/screen.c | 22 | ||||
-rw-r--r-- | src/nvim/version.c | 2 |
2 files changed, 23 insertions, 1 deletions
diff --git a/src/nvim/screen.c b/src/nvim/screen.c index 43cb6f4878..d57b84ad50 100644 --- a/src/nvim/screen.c +++ b/src/nvim/screen.c @@ -1951,6 +1951,28 @@ static void fold_line(win_T *wp, long fold_count, foldinfo_T *foldinfo, linenr_T } } + // Show colorcolumn in the fold line, but let cursorcolumn override it. + if (wp->w_p_cc_cols) { + int i = 0; + int j = wp->w_p_cc_cols[i]; + int old_txtcol = txtcol; + + while (j > -1) { + txtcol += j; + if (wp->w_p_wrap) { + txtcol -= wp->w_skipcol; + } else { + txtcol -= wp->w_leftcol; + } + if (txtcol >= 0 && txtcol < wp->w_width) { + ScreenAttrs[off + txtcol] = + hl_combine_attr(ScreenAttrs[off + txtcol], hl_attr(HLF_MC)); + } + txtcol = old_txtcol; + j = wp->w_p_cc_cols[++i]; + } + } + /* Show 'cursorcolumn' in the fold line. */ if (wp->w_p_cuc) { txtcol += wp->w_virtcol; diff --git a/src/nvim/version.c b/src/nvim/version.c index c7523bbdc7..b19fa99ee8 100644 --- a/src/nvim/version.c +++ b/src/nvim/version.c @@ -182,7 +182,7 @@ static int included_patches[] = { //670, //669 NA 668, - //667, + 667, //666 NA //665, //664 NA |