SmiteshP / nvim-navbuddy

A simple popup display that provides breadcrumbs feature using LSP server
Apache License 2.0
762 stars 30 forks source link

Focused node highlight not working properly for golang #83

Open waynerv opened 12 months ago

waynerv commented 12 months ago
image image

I am using gopls as LSP to write Go code. One common issue I encounter is that when I iterate through the fields of a struct, the focus node in both the preview window and the original window loses its foreground color (figure.1).

However, some fields are displayed correctly with highlight color(figure.2). To resolve this, I have to disable the highlight feature in the source_buffer option.

waynerv commented 12 months ago

After some research, I found that in many cases the background color of NavbuddyName is lost (more precisely, it use the background color of NavbuddyScope instead), but the foreground color still works. Don't know how all this happens.

vim.api.nvim_set_hl(0, "NavbuddyScope", { bg = "#223249" })
vim.api.nvim_set_hl(0, "NavbuddyName", { fg = "#DCD7BA", bg = "#FFA066" })

expect:

image

losing bg:

image