Mercurial > vim
changeset 5174:42d592dbbec3 v7.4a.013
updated for version 7.4a.013
Problem: Setting/resetting 'lbr' in the main help file changes alignment
after a Tab. (Dimitar Dimitrov)
Solution: Also use the code for conceal mode where n_extra is computed for
'lbr'.
author | Bram Moolenaar <bram@vim.org> |
---|---|
date | Sat, 13 Jul 2013 12:36:55 +0200 |
parents | ab94d7d4b272 |
children | 87d6016bd400 |
files | src/screen.c src/testdir/test88.in src/testdir/test88.ok src/version.c |
diffstat | 4 files changed, 22 insertions(+), 5 deletions(-) [+] |
line wrap: on
line diff
--- a/src/screen.c +++ b/src/screen.c @@ -2997,6 +2997,14 @@ win_line(wp, lnum, startrow, endrow, noc int vcol_off = 0; /* offset for concealed characters */ int did_wcol = FALSE; # define VCOL_HLC (vcol - vcol_off) +# define FIX_FOR_BOGUSCOLS \ + { \ + n_extra += vcol_off; \ + vcol -= vcol_off; \ + vcol_off = 0; \ + col -= boguscols; \ + boguscols = 0; \ + } #else # define VCOL_HLC (vcol) #endif @@ -4404,7 +4412,14 @@ win_line(wp, lnum, startrow, endrow, noc 1), (colnr_T)vcol, NULL) - 1; c_extra = ' '; if (vim_iswhite(c)) + { +#ifdef FEAT_CONCEAL + if (c == TAB) + /* See "Tab alignment" below. */ + FIX_FOR_BOGUSCOLS; +#endif c = ' '; + } } #endif @@ -4453,11 +4468,7 @@ win_line(wp, lnum, startrow, endrow, noc * and boguscols accumulated so far in the line. Note that * the tab can be longer than 'tabstop' when there * are concealed characters. */ - n_extra += vcol_off; - vcol -= vcol_off; - vcol_off = 0; - col -= boguscols; - boguscols = 0; + FIX_FOR_BOGUSCOLS; #endif #ifdef FEAT_MBYTE mb_utf8 = FALSE; /* don't draw as UTF-8 */