Dominique Pellé wrote:
> Bram Moolenaar wrote:
>
> > The other problem you mentioned, that the third argument is different
> > every time, is that really every time, also when still inside the same
> > match? I think that requires a syntax item that spans more than
> > one displayed character.
> >
> > When doing the same line again, syncing happens and will set new IDs for
> > the matched items, that is normal.
>
> Hi Bram
>
> The 3rd value returned by synconcealed() is different for each call,
> even when inside the same match. In the code review comments
> I had this example with a help page that contains concealed text:
>
> $ vim -u NONE -c 'set conceallevel=1|syntax on|help'
> :echo synconcealed(1, 1)
> [1, '', 33]
> :echo synconcealed(1, 1)
> [1, '', 43]
> :echo synconcealed(1, 1)
> [1, '', 53]
>
> It's still happening with the latest vim-8.0.662 but it now returns
> different values somehow:
>
> $ vim -u NONE -c 'set conceallevel=1|syntax on|help'
> :echo synconcealed(1, 1)
> [1, ' ', 31]
> :echo synconcealed(1, 1)
> [1, ' ', 37]
> :echo synconcealed(1, 1)
> [1, ' ', 43]
>
> That makes the 3rd value returned by synconcealed() unusable.
Well, you are supposed to get the attributes for sequential columns:
:echo synconcealed(1, 1)
:echo synconcealed(1, 2)
:echo synconcealed(1, 3)
Then it should work. If you get it for the same column, because of how
syncing works, it starts all over again at the start of the line and
keeps incrementing the ID counter.
This is indeed very ridgid and easy to get confused. Perhaps it would
work when we reset the counter at the start of the line? This assumes
you won't compare the number between two lines, which mostly makes
sense. It is possible that an item continues from the end of one line
to the next though. Oh, we can reset only when syncing, that should
always work better.
--
hundred-and-one symptoms of being an internet addict:
69. Yahoo welcomes you with your own start page
/// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net \\\
/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\ an exciting new programming language -- http://www.Zimbu.org ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///
--
--
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.