Skip to content

Conversation

@cooperrunyan
Copy link

Add set_vim_background option (default true) to control whether or not vim.opt.background = '...' is included in compiler output.

There are no breaking changes here; just the ability to opt out of the plugin setting
vim.o.background.

Why?

Neovim 0.11.0 introduced the ability to auto-detect the system's color theme, updating vim.o.background accordingly. However, this only works if the user has not set vim.o.background in their configuration already.

Example

Config (using folke/lazy.nvim)

SCR-20251002-nvaa

Default (Pre-existing) Behavior

options.set_vim_background = true (equivalent to the behavior before this PR).

set_vim_background_true.mov

Notice that the OptionSet autocommand doesn't run. This is because the colorscheme github_default_dark will set vim.o.background = 'dark'.

Feature

options.set_vim_background = false

set_vim_background_false.mov

Notice that now, the OptionSet autocommand does run, and the vim.o.background gets updated by Neovim.

Add `set_vim_background` option (default `true`) to control whether or not
`vim.opt.background = '...'` is included in compiler output.
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