Skip to content

Commit

Permalink
Use a single border again for floats
Browse files Browse the repository at this point in the history
Without borders the floats blend too much into the background.
  • Loading branch information
yorickpeterse committed Apr 15, 2024
1 parent e5fc8cc commit 14069c2
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 23 deletions.
25 changes: 12 additions & 13 deletions colors/grey.lua
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,9 @@ local highlights = {
MsgSeparator = { fg = border },
NonText = { fg = grey },
Normal = { fg = black, bg = background },
NormalFloat = { fg = black, bg = grey_bg_light },
NormalFloat = { fg = black },
FloatTitle = { fg = black, bold = true },
FloatBorder = { fg = border },
Number = { fg = blue },
Operator = { fg = black },
Pmenu = { fg = black, bg = grey_bg_light },
Expand Down Expand Up @@ -171,9 +173,6 @@ local highlights = {
diffFile = { fg = black, bold = true },
diffLine = { fg = blue },
diffRemoved = { link = 'DiffDelete' },
-- dressing.nvim
FloatTitle = { fg = black, bg = grey_bg_light, bold = true },
FloatBorder = { fg = grey_bg_light, bg = grey_bg_light },
-- Dot/Graphviz
dotKeyChar = { link = 'Operator' },
-- diffview.nvim
Expand Down Expand Up @@ -253,10 +252,10 @@ local highlights = {
DiagnosticUnderlineWarn = { underline = true, sp = dark_yellow },
LspDiagnosticsUnderlineError = { link = 'DiagnosticUnderlineError' },
LspDiagnosticsUnderlineWarning = { link = 'DiagnosticUnderlineWarn' },
DiagnosticFloatingError = { fg = red, bg = grey_bg_light, bold = true },
DiagnosticFloatingHint = { fg = black, bg = grey_bg_light, bold = true },
DiagnosticFloatingInfo = { fg = blue, bg = grey_bg_light, bold = true },
DiagnosticFloatingWarn = { fg = dark_yellow, bg = grey_bg_light, bold = true },
DiagnosticFloatingError = { fg = red, bold = true },
DiagnosticFloatingHint = { fg = black, bold = true },
DiagnosticFloatingInfo = { fg = blue, bold = true },
DiagnosticFloatingWarn = { fg = dark_yellow, bold = true },
DiagnosticError = { fg = red, bold = true },
DiagnosticHint = { fg = grey, bold = true },
DiagnosticInfo = { fg = blue, bold = true },
Expand Down Expand Up @@ -370,14 +369,14 @@ local highlights = {
typescriptIdentifier = { link = 'Identifier' },
typescriptLogicSymbols = { link = 'Operator' },
-- Telescope
TelescopeBorder = { fg = border, bg = grey_bg_light },
TelescopeBorder = { fg = border },
TelescopeMatching = { fg = dark_yellow, bold = true },
TelescopePromptNormal = { fg = black, bg = grey_bg_light },
TelescopePromptBorder = { fg = border, bg = grey_bg_light },
TelescopePromptNormal = { fg = black },
TelescopePromptBorder = { fg = border },
TelescopePromptPrefix = { fg = black, bold = true },
TelescopeSelection = { bg = light_grey, bold = true },
TelescopeTitle = { fg = black, bg = grey_bg_light, bold = true },
TelescopeNormal = { fg = black, bg = grey_bg_light },
TelescopeTitle = { fg = black, bold = true },
TelescopeNormal = { fg = black },
-- Treesitter
TSEmphasis = { italic = true },
TSField = {},
Expand Down
26 changes: 16 additions & 10 deletions lua/telescope/_extensions/grey.lua
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,20 @@ return require('telescope').register_extension({
local layout =
strats.horizontal(self, max_columns, max_lines, layout_config)

layout.prompt.borderchars = { ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ' }
layout.results.borderchars = { ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ' }
layout.prompt.borderchars =
{ '', '', '', '', '', '', '', '' }
layout.results.borderchars =
{ '', '', '', '', '', '', '', '' }
layout.results.line = layout.results.line - 1

if layout.preview then
layout.prompt.width = layout.prompt.width + layout.preview.width + 2
layout.preview.line = layout.results.line
layout.preview.height = layout.results.height
layout.preview.width = layout.preview.width
layout.preview.col = layout.preview.col
layout.preview.borderchars = { ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ' }
layout.preview.width = layout.preview.width + 1
layout.preview.col = layout.preview.col - 1
layout.preview.borderchars =
{ '', '', '', '', '', '', '', '' }
end

return layout
Expand All @@ -34,16 +37,19 @@ return require('telescope').register_extension({
strats.grey_cursor = function(self, max_columns, max_lines, layout_config)
local layout = strats.cursor(self, max_columns, max_lines, layout_config)

layout.prompt.borderchars = { ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ' }
layout.results.borderchars = { ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ' }
layout.prompt.borderchars =
{ '', '', '', '', '', '', '', '' }
layout.results.borderchars =
{ '', '', '', '', '', '', '', '' }

if layout.preview then
layout.prompt.width = layout.prompt.width + layout.preview.width + 2
layout.preview.line = layout.results.line
layout.preview.height = layout.results.height
layout.preview.width = layout.preview.width
layout.preview.col = layout.preview.col
layout.preview.borderchars = { ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ' }
layout.preview.width = layout.preview.width + 1
layout.preview.col = layout.preview.col - 1
layout.preview.borderchars =
{ '', '', '', '', '', '', '', '' }
end

return layout
Expand Down

0 comments on commit 14069c2

Please sign in to comment.