Skip to content

Commit

Permalink
feat: add disable.float_background option for transparent floats
Browse files Browse the repository at this point in the history
  • Loading branch information
rmehri01 committed Oct 22, 2023
1 parent 4c14ce8 commit c1d18ba
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ require('onenord').setup({
},
disable = {
background = false, -- Disable setting the background color
float_background = false, -- Disable setting the background color for floating windows
cursorline = false, -- Disable the cursorline
eob_lines = true, -- Hide the end-of-buffer lines
},
Expand Down
1 change: 1 addition & 0 deletions doc/onenord.nvim.txt
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ This is an example of the function with the default values:
},
disable = {
background = false, -- Disable setting the background color
float_background = false, -- Disable setting the background color for floating windows
cursorline = false, -- Disable the cursorline
eob_lines = true, -- Hide the end-of-buffer lines
},
Expand Down
1 change: 1 addition & 0 deletions lua/onenord/config.lua
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ local defaults = {
},
disable = {
background = false, -- Disable setting the background color
float_background = false, -- Disable setting the background color for floating windows
cursorline = false, -- Disable the cursorline
eob_lines = true, -- Hide the end-of-buffer lines
},
Expand Down
13 changes: 13 additions & 0 deletions lua/onenord/theme.lua
Original file line number Diff line number Diff line change
Expand Up @@ -289,6 +289,12 @@ function theme.highlights(colors, config)
remove_background(editor.SignColumn)
end

-- Set transparent float backgrounds
if config.disable.float_background then
remove_background(editor.NormalFloat)
remove_background(editor.FloatBorder)
end

-- Set transparent cursorline
if config.disable.cursorline then
remove_background(editor.CursorLine)
Expand Down Expand Up @@ -583,6 +589,7 @@ function theme.highlights(colors, config)
CmpItemKindCopilot = { fg = colors.green },

-- Notify
NotifyBackground = { fg = colors.fg, bg = colors.bg },
NotifyERRORBorder = { fg = colors.error },
NotifyWARNBorder = { fg = colors.warn },
NotifyINFOBorder = { fg = colors.info },
Expand Down Expand Up @@ -883,6 +890,12 @@ function theme.highlights(colors, config)
remove_background(plugins.NvimTreeNormal)
end

-- Set transparent float backgrounds
if config.disable.float_background then
remove_background(plugins.TelescopeNormal)
remove_background(plugins.WhichKeyFloat)
end

return plugins
end

Expand Down

0 comments on commit c1d18ba

Please sign in to comment.