Skip to content

Commit

Permalink
fix: showing error message when background color is not found (#393)
Browse files Browse the repository at this point in the history
Problem:
When highlighting a buffer that's hovered in yazi, or highlighting a
buffer that's in the same directory as the hovered file, the background
color is not found, and the highlighting is not applied. However, the
error message is also shown to the user.

I originally intended this to be a "this should never happen" kind of
error, but it's not the case. It is also shown if the user is using a
transparent background with a plugin like "xiyaowong/transparent.nvim".

See here for the exact configuration that causes this issue:
#392 (comment)

> I use tokyonight theme and "xiyaowong/transparent.nvim" plugin to
> toggle transparency
>
> https://github.com/xiyaowong/transparent.nvim

Solution:
Remove the error message, and let the highlighting fail silently.

Resolves #392
  • Loading branch information
mikavilpas authored Aug 18, 2024
1 parent f1d1c2a commit b2c0bf3
Showing 1 changed file with 0 additions and 4 deletions.
4 changes: 0 additions & 4 deletions lua/yazi/buffer_highlighting/window_highlight.lua
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,6 @@ function WindowHighlight:set_highlight(
local color = create_hover_color_from_theme(lighten_or_darken)
if color == nil then
Log:debug("Could not find a background color, not highlighting")
vim.notify(
"Could not find a background color, not highlighting",
vim.log.levels.ERROR
)

return
end
Expand Down

0 comments on commit b2c0bf3

Please sign in to comment.