Hi Dominique.
Thank you for testing this. The patch was missing a simple test in the
macro FIX_FOR_BOGUSCOLS. I added that in a new patch attached: now it
should work.
Cheers.
2015-07-12 5:33 GMT+03:00 Dominique Pellé <[email protected]>:
> Dominique Pellé wrote:
>
> > Christian Brabandt <[email protected]> wrote:
> >
> >> Hi Bram!
> >>
> >> On Di, 07 Jul 2015, Bram Moolenaar wrote:
> >>
> >>> Christian, since you worked in this area for the linebreak stuff, can
> >>> you check if this patch improves things?
> >>
> >> I am currently short on time and have to fix the visual increment
> >> feature, so I can't look at it before the end of the week (or even
> >> later).
> >
> > I'll also have a look at the colorcolumn+conceal patch,
> > but not before the weekend either.
>
> Hi
>
> I've tried the proposed patch vim-wrap-conceal-voodoo-2.patch
> from Alexey, but it does not work properly for me. For example,
> type the following command:
>
> $ vim -u NONE -c 'set conceallevel=2 colorcolumn=20 cuc' \
> -c 'syntax on' -c 'filetype on' -c h -c 'norm 34zz50|'
>
> And observe that alignment of both colorcolumn and current
> column looked good prior to the patch, but look misaligned
> after the patch.
>
> I tried with vim-7.4.778.
>
> Regards
> Dominique
>
> --
> --
> You received this message from the "vim_dev" maillist.
> Do not top-post! Type your reply below the text you are replying to.
> For more information, visit http://www.vim.org/maillist.php
>
> ---
> You received this message because you are subscribed to the Google Groups
> "vim_dev" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> For more options, visit https://groups.google.com/d/optout.
>
--
--
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php
---
You received this message because you are subscribed to the Google Groups
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.
diff -r bfc3682510d6 src/screen.c
--- a/src/screen.c Sat Jul 04 15:05:14 2015 +0200
+++ b/src/screen.c Sun Jul 12 08:55:10 2015 +0300
@@ -3043,16 +3043,21 @@
int prev_syntax_id = 0;
int conceal_attr = hl_attr(HLF_CONCEAL);
int is_concealing = FALSE;
+ int is_wrapping = FALSE;
int boguscols = 0; /* nonexistent columns added to force
wrapping */
int vcol_off = 0; /* offset for concealed characters */
+ int vcol_adj_wrap = 0; /* adjustment for wrapped cuc and
+ colorcolum */
int did_wcol = FALSE;
int old_boguscols = 0;
-# define VCOL_HLC (vcol - vcol_off)
+# define VCOL_HLC (vcol - vcol_off + vcol_adj_wrap)
# define FIX_FOR_BOGUSCOLS \
{ \
n_extra += vcol_off; \
vcol -= vcol_off; \
+ if (!is_wrapping) \
+ vcol_adj_wrap += vcol_off; \
vcol_off = 0; \
col -= boguscols; \
old_boguscols = boguscols; \
@@ -5449,6 +5454,7 @@
* we are building, 'boguscols' keeps track of the number
* of bad columns we have advanced.
*/
+ is_wrapping = TRUE;
if (n_extra > 0)
{
vcol += n_extra;
@@ -5559,6 +5565,9 @@
SCREEN_LINE(screen_row, W_WINCOL(wp), col - boguscols,
(int)W_WIDTH(wp), wp->w_p_rl);
boguscols = 0;
+ if (is_wrapping)
+ vcol_adj_wrap = vcol_off;
+ is_wrapping = FALSE;
#else
SCREEN_LINE(screen_row, W_WINCOL(wp), col,
(int)W_WIDTH(wp), wp->w_p_rl);