Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat!: add default colors for hover highlighting #194

Merged
merged 2 commits into from
Jul 14, 2024

Conversation

mikavilpas
Copy link
Owner

@mikavilpas mikavilpas commented Jul 14, 2024

Hover highlighting is now enabled by default

(Hover highlighting is a feature currently requiring opt-in that was added in #180)

This works with the latest yazi when use_ya_for_events_reading = true is specified. To learn more about enabling this, see #152

This will be the default behaviour when yazi 0.3 is released.

Hover highlighting colors no longer require manual configuration

Dark mode

(neovim: catppuccin macchiato, yazi: catppuccin macchiato)

autocolors-dark.mov

Light mode

(neovim: catppuccin latte, yazi: catppuccin macchiato)

Just focus on the background color of the hovered buffer as I couldn't be bothered to change my yazi theme 😅

autocolors-light.mov

This change adds default colors for the hover highlighting feature. The logic supports both light and dark colorschemes:

  • for dark colorschemes, the hovered buffer will be lighter in color
  • for light colorschemes, it will be darker

The logic is borrowed from the bufferline.nvim plugin, which has a lot of users and is well-maintained. This also adds a dependency to bufferline.nvim, but as an optimization only its color utility functions are used as late as possible, and even they are only used when the user hasn't specified a custom highlight color.

⚠️ BREAKING CHANGE:

The optional hovered_buffer_background key in the YaziConfigHighlightGroups has been renamed to hovered_buffer. This change was made to better reflect the purpose of the key.

To migrate, run this 🙂

:%s/hovered_buffer_background/hovered_buffer/gc

Hover highlighting is now enabled by default
===
This works with the latest yazi when `use_ya_for_events_reading = true`
is specified. To learn more about enabling this, see
<#152>

This will be the default behaviour when yazi 0.3 is released.

Hover highlighting colors no longer require manual configuration
===

This change adds default colors for the hover highlighting feature. The
logic supports both light and dark colorschemes:
- for dark colorschemes, the hovered buffer will be lighter in color
- for light colorschemes, it will be darker

The logic is borrowed from the `bufferline.nvim` plugin, which has a lot
of users and is well-maintained. This also adds a dependency to
bufferline.nvim, but as an optimization only its color utility functions
are used as late as possible, and even they are only used when the user
hasn't specified a custom highlight color.

BREAKING CHANGE: The optional `hovered_buffer_background` key in the
`YaziConfigHighlightGroups` has been renamed to `hovered_buffer`. This
change was made to better reflect the purpose of the key.

To migrate, run this 🙂

```vim
:%s/hovered_buffer_background/hovered_buffer/gc
```
@mikavilpas mikavilpas merged commit 1deeba2 into main Jul 14, 2024
14 checks passed
@mikavilpas mikavilpas deleted the default-colors-for-hover-highlighting branch July 14, 2024 17:25
This was referenced Jan 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant