Comments (5)
statusline=%#lualine_a_command# COMMAND %<%#lualine_c_command# main.go [+] %#lualine_c_command# %#lualine_c_command#%=%#NavicIconsInterface# 練%*%#NavicText#I%*%#NavicSeparator#
%*%#NavicIconsMethod# %*%#NavicText#cc%* %#lualine_c_command#%#lualine_c_command# utf-8 %#lualine_c_command# %#lualine_x_filetype_DevIconGo_command# %#lualine_c_command# go %#lua
line_b_command# 80%% %#lualine_a_command# 4:5
from sonokai.
Could you please share the output of :set statusline?
while on that symbol?
from sonokai.
Very sorry for the delayed answer. I finally found the time to look into this.
I was able to reproduce:
Quick analysis:
" highlight = false
statusline=%#lualine_a_2_command# %#lualine_b_3_command# main %<%#lualine_c_diff_added_command# 11 %#lualine_c_diff_modified_command# 13 %#lualine_c_diff_removed_command# 1 %#lualine_c_command#%=%#lualine_c_command# lvim.colorscheme %#lualine_b_command# 13:26 %#lualine_z_progress_command# %P/%L
" highlight = true
statusline=%#lualine_a_2_command# %#lualine_b_3_command# main %<%#lualine_c_diff_added_command# 11 %#lualine_c_diff_modified_command# 13 %#lualine_c_diff_removed_command# 1 %#lualine_c_command#%=%#NavicIconsString# %*%#NavicText#lvim.colorscheme%* %#lualine_b_command# 13:26 %#lualine_z_progress_command# %P/%L
I think the issue is that the NavicIcons*
highlight groups indirectly reset the background to NONE
, whereas they should inherit the background value of the lualine section they are located in.
I don't think there is a way to achieve this in the colorscheme. I have a feeling that this requires some integration between lualine and navic to dynamically adjust the background values of all NavicIcons*
highlight groups based on the lualine section.
One example is lualine's LSP diagnostic component, which creates highlight groups on the fly during initialization.
The Git diff component—visible in the lualine section C in my screenshots—is initialized in the same manner (lualine_c_diff_added_*
, lualine_c_diff_modified_*
, etc.).
A few additional interesting code locations, for future reference: 1, 2, 3.
For the time being, the simplest workaround is to override NavicIcons*
highlight groups using an autocmd as shown below. Simply add to your Neovim config:
-- Apply custom highlights on colorscheme change.
-- Must be declared before executing ':colorscheme'.
grpid = vim.api.nvim_create_augroup('custom_highlights_sonokai', {})
vim.api.nvim_create_autocmd('ColorScheme', {
group = grpid,
pattern = 'sonokai',
callback = function()
-- navic colors for lualine
local config = vim.fn['sonokai#get_configuration']()
local palette = vim.fn['sonokai#get_palette'](config.style, config.colors_override)
local navic_bg = palette.bg1[1]
local function set_hl(name, fg)
vim.api.nvim_set_hl(0, name, { foreground = fg, background = navic_bg })
end
local function get_hl(name)
return vim.api.nvim_get_hl_by_name(name, true).foreground
end
set_hl('NavicText', get_hl('Fg'))
set_hl('NavicSeparator', get_hl('Grey'))
for _, c in ipairs(vim.g.sonokai_lsp_kind_color) do
set_hl('NavicIcons' .. c[1], get_hl(c[2]))
end
end
})
Result:
from sonokai.
Thank you for your detailed answer and help!
from sonokai.
If turns out that navic had options for color correction, specially designed for it to be embedded into a statusline: https://github.com/SmiteshP/nvim-navic/blob/83dc174da915f9dbc9b51169e9b62a2e0d42b527/README.md?plain=1#L275-L281
from sonokai.
Related Issues (20)
- A lot of highlight warning. HOT 2
- How to change style to Andromeda in lua? HOT 2
- Emacs Port? HOT 4
- bufferline HOT 3
- Can't have transparent background Everywhere HOT 3
- How to set Espresso mode? HOT 2
- Interest in support nvim lsp semantic highlighting? HOT 6
- LSP saga floating window design HOT 9
- Support Neo-tree.nvim HOT 5
- help with folke/noice.nvim and mini view HOT 5
- Configuration for dim float window style HOT 2
- Questions: Better way to highlight variable with {} in shell script HOT 1
- Question: Better highlighter command support for Dockerfile with treesitter HOT 6
- Support vim HOT 3
- Variables starting with uppercase letter have different color HOT 4
- Add support for NotifyBackground HOT 1
- Would you be interested in a PR for a new palette? HOT 4
- Is there a way to toggle the transparency setting at runtime? HOT 7
- xresources, base16-snazy HOT 10
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from sonokai.