Hi
On Di, 14 Jun 2011, hsitz wrote:
> On Jun 14, 7:35 pm, Bram Moolenaar <[email protected]> wrote:
> > That's a bug.
>
> Thanks for confirming. I will move to vim-dev. Here are some steps
> to reproduce it.
>
> 1. Create a document with this line of text:
> This is text. [abcd] The text in brackets is concealed.
>
> 2. :syn match MyHiddenText conceal '\[.\{-1,}]'
>
> 3. :set conceallevel=3
>
> 4. :set concealcursor=nc
>
> The brackets and text inside should now be invisible. Click with the
> mouse on the 'b' in 'brackets' and the cursor appears on the line 6
> chars to the left of where you click. The problem happens with both
> 'conceal' areas and 'concealends' areas.
Attached patch fixes it.
regards,
Christian
--
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
diff --git a/src/ui.c b/src/ui.c
--- a/src/ui.c
+++ b/src/ui.c
@@ -2955,6 +2955,33 @@
col += row * (W_WIDTH(win) - off);
/* add skip column (for long wrapping line) */
col += win->w_skipcol;
+
+#ifdef FEAT_CONCEAL
+ if (curwin->w_p_cole >= 3)
+ {
+ char_u *linep = ml_get(lnum);
+ int runs;
+ int skip_conc = 0;
+ int concealcol = 0;
+ int i = 0;
+
+ for (runs=0; runs<=col; runs++)
+ {
+ (void)syn_get_id(curwin, lnum, i, FALSE, NULL, TRUE);
+ if (get_syntax_info(&concealcol) & HL_CONCEAL)
+ skip_conc++;
+#ifdef FEAT_MBYTE
+ if (has_mbyte)
+ i += mb_ptr2len(linep + i);
+ else
+#endif
+ i++;
+ }
+ /* add skip column (for concealed chars) */
+ col += skip_conc;
+ }
+#endif
+
}
if (!win->w_p_wrap)