Hi,

On Mon, Jun 3, 2019 at 10:12 AM Daniel Hahler <[email protected]> wrote:
>
> https://github.com/vim/vim/blob/98fb65cb051f625f4ce291a9f9cdb2e54ac1e688/runtime/doc/sign.txt#L185-L187:
>
> The priority is used to determine the
> highlight group used when multiple signs are placed on the
> same line.
>
> I assume it is not just used for the highlight group, but for the sign being 
> displayed altogether?
>

Yes. The sign priority is used to determine the sign that will be
displayed in a line.

>
> At least that's how I would expect it, and a quick test shows that this is 
> the case, using:
>
> sign define mysign1 text=s1 texthl=Error
> sign define mysign2 text=s2 texthl=Todo
>
> exe 'sign unplace * buffer='.bufnr('%')
> sign place 1 line=1 name=mysign1 priority=10
> sign place 2 line=1 name=mysign2 priority=20
> sign place 3 line=1 name=mysign1 priority=10
>
> echo map(sign_getplaced(bufnr('%'))[0].signs, 'v:val.name')
>
> It displays ['mysign2', 'mysign1', 'mysign1'], and the sign text is "s2" 
> (with its highlight).
>
> It should also be clarified with sign_getplaced() which currently only says:
>
> The returned signs in a buffer are ordered by their line
> number.
>
> From my observation it returns signs as being displayed (first entry is the 
> visible one).
>

Yes. The sign_getplaced() function returns all the signs placed in a buffer.
If multiple signs are placed on a line, then the signs are sorted by
their priority.
If two or more signs have the same priority, then they are sorted by their order
of placement (the last placed sign takes precedence over the older ones).

- Yegappan

>
> Something to consider here is also signs with the same ID - from my 
> observation the last placed
> one is visible, regardless of priority (i.e. if placing id=1 with 
> priority=50, and then with
> priority=10, it will display the 2nd one).
>
> sign-priority appears to be clear(er) about it already.
>

-- 
-- 
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].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_dev/CAAW7x7%3DEwMaK8FMk5p2jRQoJYKWvZnwKeJ0%3DNnUbJ85wQ613NA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Raspunde prin e-mail lui