[vim/vim] Spelling error highlight overrulles text properties (#8183)

24 views
Skip to first unread message

Sergey Vlasov

unread,
May 7, 2021, 6:00:50 AM5/7/21
to vim/vim, Subscribed

Describe the bug
SpellBad highlight colors overrule the colors of text properties. Using gui=nocombine, combine: v:false has no effect to the colors.

To Reproduce

  1. Run vim:
vim -g -u NONE \
  +'set spell' \
  +'hi SpellBad guifg=red guibg=blue gui=NONE' \
  +'hi MyProp guifg=white guibg=green gui=bold' \
  +'enew' \
  +'call setbufline(bufnr(), 1, "Room tempreture")' \
  +'call prop_type_add("my_prop", #{highlight: "MyProp", combine: v:false, priority: 1000})' \
  +'call prop_add(1, 3, #{length: 8, type: "my_prop"})'

Actual behavior
image

Expected behavior
image

Environment

  • Vim 8.2.2836
  • OS: Ubuntu 20.04
  • Terminal: GUI

Additional context
Although it's not very clear from the screenshots but the tempr part is properly rendered bold, only the colors are wrong.


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or unsubscribe.

Bram Moolenaar

unread,
May 7, 2021, 8:33:17 AM5/7/21
to vim/vim, Subscribed


> **Describe the bug**
> `SpellBad` highlight colors overrule the colors of text properties.
> Using `gui=nocombine`, `combine: v:false` has no effect to the colors.
>
>
> **To Reproduce**
> 1. Run vim:

> ```
> vim -g -u NONE \
> +'set spell' \
> +'hi SpellBad guifg=red guibg=blue gui=NONE' \
> +'hi MyProp guifg=white guibg=green gui=bold' \
> +'enew' \
> +'call setbufline(bufnr(), 1, "Room tempreture")' \
> +'call prop_type_add("my_prop", #{highlight: "MyProp", combine: v:false, priority: 1000})' \
> +'call prop_add(1, 3, #{length: 8, type: "my_prop"})'
> ```
>
> **Actual behavior**
> ![image](https://user-images.githubusercontent.com/717109/117430660-ff36bb00-af30-11eb-813c-83fcea4adb74.png)
>
> **Expected behavior**
> ![image](https://user-images.githubusercontent.com/717109/117431268-b59aa000-af31-11eb-872a-1668b4fc0f9f.png)
>
> **Environment**
> - Vim 8.2.2836
> - OS: Ubuntu 20.04
> - Terminal: GUI
>
> **Additional context**

> Although it's not very clear from the screenshots but the `tempr` part
> is properly rendered bold, only the colors are wrong.

This is not a bug but something that isn't supported.

We could add a flag to specify that the text property overrules any
other highlight. Or perhaps combine with priority. But there are more
combinations if we consider different kinds of highlighting: Visual
area, search, syntax, etc.

I wonder how we can keep this simple and still provide sufficient
control.

--
hundred-and-one symptoms of being an internet addict:
241. You try to look for Net Search even when you're in File Manager.

/// Bram Moolenaar -- Br...@Moolenaar.net -- http://www.Moolenaar.net \\\
/// \\\
\\\ sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///

Sergey Vlasov

unread,
May 7, 2021, 10:54:29 AM5/7/21
to vim/vim, Subscribed

It's hard to come up with an elegant and long term solution. But maybe it could all work out based on priority level alone. But then priorities across all kinds of highlighting should work together and it should be possible to set priority for every kind.

Reply all
Reply to author
Forward
0 new messages