diff options
author | David Bürgin <676c7473@gmail.com> | 2015-05-09 16:03:07 +0200 |
---|---|---|
committer | Justin M. Keyes <justinkz@gmail.com> | 2015-05-13 03:15:52 -0400 |
commit | af4b0a76a757f44ea7fbfc8e1c863952adc6ac1e (patch) | |
tree | c7f3c3bdb322360caae2abd65296d4586b3ed890 /src | |
parent | 6a1d89462b6af3ed03a287f80105a7209c1ffac4 (diff) | |
download | rneovim-af4b0a76a757f44ea7fbfc8e1c863952adc6ac1e.tar.gz rneovim-af4b0a76a757f44ea7fbfc8e1c863952adc6ac1e.tar.bz2 rneovim-af4b0a76a757f44ea7fbfc8e1c863952adc6ac1e.zip |
vim-patch:7.4.587 #2622
Problem: Conceal does not work properly with 'linebreak'. (cs86661)
Solution: Save and restore boguscols. (Christian Brabandt)
https://github.com/vim/vim/commit/v7-4-587
Diffstat (limited to 'src')
-rw-r--r-- | src/nvim/screen.c | 18 | ||||
-rw-r--r-- | src/nvim/version.c | 2 |
2 files changed, 17 insertions, 3 deletions
diff --git a/src/nvim/screen.c b/src/nvim/screen.c index 8761e44196..6e3a4932a8 100644 --- a/src/nvim/screen.c +++ b/src/nvim/screen.c @@ -2174,6 +2174,7 @@ win_line ( wrapping */ int vcol_off = 0; /* offset for concealed characters */ int did_wcol = FALSE; + int old_boguscols = 0; # define VCOL_HLC (vcol - vcol_off) # define FIX_FOR_BOGUSCOLS \ { \ @@ -2181,6 +2182,7 @@ win_line ( vcol -= vcol_off; \ vcol_off = 0; \ col -= boguscols; \ + old_boguscols = boguscols; \ boguscols = 0; \ } @@ -3369,10 +3371,15 @@ win_line ( int i; int saved_nextra = n_extra; - if (is_concealing && vcol_off > 0) { + if ((is_concealing || boguscols > 0) && vcol_off > 0) { // there are characters to conceal tab_len += vcol_off; } + // boguscols before FIX_FOR_BOGUSCOLS macro from above. + if (wp->w_p_list && lcs_tab1 && old_boguscols > 0 + && n_extra > tab_len) { + tab_len += n_extra - tab_len; + } /* if n_extra > 0, it gives the number of chars to use for * a tab, else we need to calculate the width for a tab */ @@ -3394,7 +3401,7 @@ win_line ( // n_extra will be increased by FIX_FOX_BOGUSCOLS // macro below, so need to adjust for that here - if (is_concealing && vcol_off > 0) { + if ((is_concealing || boguscols > 0) && vcol_off > 0) { n_extra -= vcol_off; } } @@ -3405,6 +3412,13 @@ win_line ( * the tab can be longer than 'tabstop' when there * are concealed characters. */ FIX_FOR_BOGUSCOLS; + // Make sure that the highlighting for the tab char will be correctly + // set further below (effectively reverts the FIX_FOR_BOGSUCOLS + // macro). + if (old_boguscols > 0 && n_extra > tab_len && wp->w_p_list + && lcs_tab1) { + tab_len += n_extra - tab_len; + } mb_utf8 = FALSE; /* don't draw as UTF-8 */ if (wp->w_p_list) { c = lcs_tab1; diff --git a/src/nvim/version.c b/src/nvim/version.c index e786b2ffca..019f51eb4d 100644 --- a/src/nvim/version.c +++ b/src/nvim/version.c @@ -196,7 +196,7 @@ static int included_patches[] = { 590, //589 NA 588, - //587, + 587, //586 NA 585, //584 NA |