Mercurial > vim
comparison src/screen.c @ 6520:70793fedd25a v7.4.587
updated for version 7.4.587
Problem: Conceal does not work properly with 'linebreak'. (cs86661)
Solution: Save and restore boguscols. (Christian Brabandt)
author | Bram Moolenaar <bram@vim.org> |
---|---|
date | Tue, 20 Jan 2015 19:01:35 +0100 |
parents | 134a7d55f9fa |
children | 0c8738124a7b |
comparison
equal
deleted
inserted
replaced
6519:4dd5e57a2013 | 6520:70793fedd25a |
---|---|
3001 int is_concealing = FALSE; | 3001 int is_concealing = FALSE; |
3002 int boguscols = 0; /* nonexistent columns added to force | 3002 int boguscols = 0; /* nonexistent columns added to force |
3003 wrapping */ | 3003 wrapping */ |
3004 int vcol_off = 0; /* offset for concealed characters */ | 3004 int vcol_off = 0; /* offset for concealed characters */ |
3005 int did_wcol = FALSE; | 3005 int did_wcol = FALSE; |
3006 int old_boguscols = 0; | |
3006 # define VCOL_HLC (vcol - vcol_off) | 3007 # define VCOL_HLC (vcol - vcol_off) |
3007 # define FIX_FOR_BOGUSCOLS \ | 3008 # define FIX_FOR_BOGUSCOLS \ |
3008 { \ | 3009 { \ |
3009 n_extra += vcol_off; \ | 3010 n_extra += vcol_off; \ |
3010 vcol -= vcol_off; \ | 3011 vcol -= vcol_off; \ |
3011 vcol_off = 0; \ | 3012 vcol_off = 0; \ |
3012 col -= boguscols; \ | 3013 col -= boguscols; \ |
3014 old_boguscols = boguscols; \ | |
3013 boguscols = 0; \ | 3015 boguscols = 0; \ |
3014 } | 3016 } |
3015 #else | 3017 #else |
3016 # define VCOL_HLC (vcol) | 3018 # define VCOL_HLC (vcol) |
3017 #endif | 3019 #endif |
4543 int len = n_extra; | 4545 int len = n_extra; |
4544 int i; | 4546 int i; |
4545 int saved_nextra = n_extra; | 4547 int saved_nextra = n_extra; |
4546 | 4548 |
4547 #ifdef FEAT_CONCEAL | 4549 #ifdef FEAT_CONCEAL |
4548 if (is_concealing && vcol_off > 0) | 4550 if ((is_concealing || boguscols > 0) && vcol_off > 0) |
4549 /* there are characters to conceal */ | 4551 /* there are characters to conceal */ |
4550 tab_len += vcol_off; | 4552 tab_len += vcol_off; |
4551 #endif | 4553 /* boguscols before FIX_FOR_BOGUSCOLS macro from above |
4554 */ | |
4555 if (wp->w_p_list && lcs_tab1 && old_boguscols > 0 | |
4556 && n_extra > tab_len) | |
4557 tab_len += n_extra - tab_len; | |
4558 #endif | |
4559 | |
4552 /* if n_extra > 0, it gives the number of chars, to | 4560 /* if n_extra > 0, it gives the number of chars, to |
4553 * use for a tab, else we need to calculate the width | 4561 * use for a tab, else we need to calculate the width |
4554 * for a tab */ | 4562 * for a tab */ |
4555 #ifdef FEAT_MBYTE | 4563 #ifdef FEAT_MBYTE |
4556 len = (tab_len * mb_char2len(lcs_tab2)); | 4564 len = (tab_len * mb_char2len(lcs_tab2)); |
4575 } | 4583 } |
4576 p_extra = p_extra_free; | 4584 p_extra = p_extra_free; |
4577 #ifdef FEAT_CONCEAL | 4585 #ifdef FEAT_CONCEAL |
4578 /* n_extra will be increased by FIX_FOX_BOGUSCOLS | 4586 /* n_extra will be increased by FIX_FOX_BOGUSCOLS |
4579 * macro below, so need to adjust for that here */ | 4587 * macro below, so need to adjust for that here */ |
4580 if (is_concealing && vcol_off > 0) | 4588 if ((is_concealing || boguscols > 0) && vcol_off > 0) |
4581 n_extra -= vcol_off; | 4589 n_extra -= vcol_off; |
4582 #endif | 4590 #endif |
4583 } | 4591 } |
4584 #endif | 4592 #endif |
4585 #ifdef FEAT_CONCEAL | 4593 #ifdef FEAT_CONCEAL |
4588 * previous concealed characters, and thus resets vcol_off | 4596 * previous concealed characters, and thus resets vcol_off |
4589 * and boguscols accumulated so far in the line. Note that | 4597 * and boguscols accumulated so far in the line. Note that |
4590 * the tab can be longer than 'tabstop' when there | 4598 * the tab can be longer than 'tabstop' when there |
4591 * are concealed characters. */ | 4599 * are concealed characters. */ |
4592 FIX_FOR_BOGUSCOLS; | 4600 FIX_FOR_BOGUSCOLS; |
4601 /* Make sure, the highlighting for the tab char will be | |
4602 * correctly set further below (effectively reverts the | |
4603 * FIX_FOR_BOGSUCOLS macro */ | |
4604 if (old_boguscols > 0 && n_extra > tab_len && wp->w_p_list | |
4605 && lcs_tab1) | |
4606 tab_len += n_extra - tab_len; | |
4593 #endif | 4607 #endif |
4594 #ifdef FEAT_MBYTE | 4608 #ifdef FEAT_MBYTE |
4595 mb_utf8 = FALSE; /* don't draw as UTF-8 */ | 4609 mb_utf8 = FALSE; /* don't draw as UTF-8 */ |
4596 #endif | 4610 #endif |
4597 if (wp->w_p_list) | 4611 if (wp->w_p_list) |