Re: [vim/vim] complete_info() does not report the item highlight groups (PR #21105)

h_east (Vim Github Repository) <[email protected]>
Newsgroups gmane.editors.vim.devel
Message-ID <vim/vim/pull/21105/[email protected]>
h-east left a comment (vim/vim#21105)

The round trip does not survive a highlight group that is not defined yet.

`get_user_highlight_id()` calls `syn_name2id()`, which returns 0 for a name no
`:highlight` has created, and `syn_id2name(0)` is an empty string. So an item
passed to `complete()` with `abbr_hlgroup: 'MyKind'` comes back from
`complete_info()` with an empty `abbr_hlgroup`, and feeding it back in drops
the highlight. A client that links its groups with `:highlight default link`
when it loads, or leaves them to the user, runs into this. The added test uses
`Title` and `SpecialKey`, which already exist, so it does not cover it.

Keeping the name instead of the ID would not have that hole.

One more thing: holding the ID rather than the resolved attribute means the
menu now follows a `:highlight` issued after `complete()`. That looks like an
improvement, but it is a behaviour change and it is not in the commit message
or the docs.


-- 
Reply to this email directly or view it on GitHub:
https://github.com/vim/vim/pull/21105#issuecomment-5366302056
You are receiving this because you are subscribed to this thread.

Message ID: <vim/vim/pull/21105/[email protected]>

-- 
-- 
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 visit https://groups.google.com/d/msgid/vim_dev/vim/vim/pull/21105/c5366302056%40github.com.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.